This project automates the deployment of an AWS EC2 instance, sets up security groups, configures a Cloudflare subdomain, installs Docker using Ansible, and deploys a portfolio website inside a Docker container. The entire deployment process is automated using Terraform, Ansible, and Bash scripting.
- Automates AWS EC2 instance creation using Terraform.
- Configures security groups for SSH, HTTP, and HTTPS access.
- Updates Cloudflare DNS to point to the instance.
- Uses Ansible to install Docker on the instance.
- Deploys a Dockerized portfolio website.
- Provides automated deployment using a Bash script.
- AWS account with access to create EC2 instances.
- Cloudflare account with API token.
- Terraform installed on your local machine.
- Ansible installed on your local machine.
- SSH key for authentication.
git clone https://github.com/saurabh-mate/Terraform-Automation.git
cd Terraform-AutomationUpdate the variables.tf file with your Cloudflare API token and Zone ID.
terraform initterraform apply -auto-approvebash deploy.sh- Public IP of the EC2 instance.
- Cloudflare subdomain URL (
http://saurabh.purvesh.cloud). - Confirmation message upon successful deployment.
Once deployed, you can access the portfolio website at:
http://saurabh.purvesh.cloud
To destroy the infrastructure, run:
terraform destroy -auto-approveThis project is licensed under the MIT License.