End-to-End AWS Infrastructure Deployment: Terraform, Docker, CI/CD, and Live Data Visualization with Metabase
This repository showcases a complete deployment of a PHP application on AWS using Terraform, Docker, AWS CodeDeploy and CodePipeline.
- Project Overview
- Getting Started
- Infrastructure Setup
- CI/CD Pipeline
- Domain and SSL Configuration
- Monitoring
This project demonstrates the following key aspects:
- Infrastructure as Code (IaC): Automated deployment of AWS resources including VPC with private subnets using Terraform.
- AWS Services: Deployment of EC2 instances, RDS, S3, and more.
- Application Setup: Nginx and PHP applications deployed using Docker containers.
- CI/CD Pipeline: Continuous Integration and Continuous Deployment using AWS CodeDeploy.
- Security: SSL certificates configuration via Cloudflare.
- Live Visualization: Metabase BI tool for monitoring the RDS MySQL database.
- Access Management: Secure access to private resources using a jump server.
To get a local copy up and running, follow these steps.
- AWS Account
- Terraform
- Docker
- AWS CLI
- Cloudflare Account
- Configure AWS CLI:
aws configure
- Apply Terraform Configuration:
terraform init
terraform plan
terraform apply
- Access Jump Server:
ssh -i your-key.pem ec2-user@jump-server-ip
- Access Backend Server via Jump Server:
ssh -i your-key.pem ec2-user@private-vm-ip
- Setup Docker and Docker-Compose:
- Ensure Docker and Docker-Compose are installed on the deployment servers.
- Configure CodeDeploy:
- Use the provided appspec.yml and buildspec.yml files to setup CodeDeploy.
- Deploy Applications:
- Deploy Nginx and PHP applications using Docker containers.
- Domain Setup:
- Configure your domain with Cloudflare.
- SSL Certificates:
- Add a CNAME record in Cloudflare to get free SSL certificates for your domain.
- Setup Metabase:
-
Deploy Metabase using Docker.
-
Configure Metabase to monitor the RDS MySQL database.