Terraform and ansible code to deploy an High Availability Laravel Application in AWS using.
The infrastructure is well schematized by this picture:
To try the infrastracture on your AWS account, make sure to configure aws cli and then run the below code from your project directory:
terraform init
terraform plan
terraform apply
The infrastructure is planned to be deployed in eu-west-1 zone, on two availability zones (eu-west-1a and eu-west-1b). It is composed by the following modules:
The networking module is based on the vpc module, which with few lines of code builds up a VPC, configures subnets, the internet gateway and route tables.
The data layer builds the following components:
- RDS Aurora Cluster with two instances, one per availability zone.
The application layer builds the following components:
- An application load balancer.
- A launch configuration which installs apache, php and wordpress on Amazon Linux 2 machines.
- An autoscaling group.
- A bastion server to reach out the VMs within the autoscaling group.