This is an ansible playbook, it make use of terraform code to deploy aws infra( EC2, ALB, SGs, VPC) and ansible yml to setup containers on the EC2 instances, which is then load balanced with a Nginx Container. The Playbook itself contain two plays, one for
-
main.yml
- Invoke Terraform scripts.
- Set Dynamic Inventory files.
- Create and configure Docker containers.
- Pushes latest image to Docker HUB.
-
terraform/main.tf
- Setting UP VPC with mentioned CIDR block
- Create EC2 instances, on the mentioned AZs.
- Configure Application Load Balancer.
NOTE: not Included all the service just an outline below.