Creates multi-AZ infrastructure on AWS and runs a simple python application on it.
Terraform script execution results in followings.
- Creates a VPC.
- Creates two public subnets in different AZs inside the VPC.
- Creates two private subnets in different AZs inside the VPC.
- Creates two EC2 instances in public subnets.
- Creates a multi-AZ RDS instance in private subnets.
- Creates an ELB on top of EC2 instances.
- Clone the project.
- cd into the project root folder.
- Install Terraform.
- Make sure you have set your AWS cedentials.
- Specify ssh public key path via SSH_PUBLIC_KEY environment variable (e.g. export SSH_PUBLIC_KEY="~/.ssh/id_rsa.pub").
- Run deploy.sh script to deploy the stack.
- Run destroy.sh script to destroy the stack.
- Add ability for users to pass the AWS region to terraform code, and retrieve AMI from AWS dynamically.
- Use Terraform modules to avoid code duplications and make the code more reusable.
- Make the infrastructure auto scalable to support high load.