This project demonstrates how to use Terraform to provision EC2 instances, set up an Elastic Load Balancer (ELB), and then use Ansible to configure the instances with NGINX, set the timezone to Africa/Lagos, and deploy a simple HTML page. The infrastructure is hosted on AWS, and DNS configuration is done using AWS Route 53.
Before you begin, ensure you have the following prerequisites installed:
-
Create a "variables.tfvars" file and update it with your AWS credentials as seen in the example tfvars file.
-
Run Terraform commands to initialize and apply the infrastructure:
terraform init terraform apply -var-file="variables.tfvars"
-
Terraform will prompt you to confirm the plan. Type
yes
to proceed.
Once the infrastructure is deployed and configured, you can access the web application by navigating to:
http://terraform-test.fotisia.com