This is an example of deploying an HA webapp on AWS with Terraform and CoreOS.
- CoreOS instance bootstrapped using ignition.
- Runs web server as a systemd service with nginx container.
- Nginx config, custom 404 page and default index page are bootstrapped and mounted into the container (For demo purpose only, images should be built and pushed to registry.)
- A public facing host that allows system admins to management instances in the same VPC.
- ALB load balances web traffic to all web servers across multiple AZs
- Terminates SSL at ALB
- Two listners. Reidrects HTTP to HTTPS
- Communication between ALB and web servers is HTTP
- Loads launch configuration from rendered Ignition config
- Auto scales web instances across multiple AZs
- Attaches to afore created ALB
- Self signed certs
- Imported into ACM
Users
| http / https
ALB (http -> https)
| http
Instances
- Set up proper AWS creds
- Modify
vars.tf
accordingly - Run terraform
terraform init
terraform plan
terraform apply
SSH private key is genreated by Terraform. To get the private key, you can run the following command:
terraform state show tls_private_key.ssh