This is an example of fully automated deployment of wordpress app to aws using Terraform, ansible and shell script.
- Install Terraform
- Install Ansible
- Install awscli
- Configure awscli with key and secret (
aws configure
)
- git clone git@github.com:bhegazy/terraform-wordpress.git
- cd terraform-wordpress
./deploy.sh --app=<app_name> --environment=<environment> --num=<number_of_aws_instances> --size=<aws_instance_size>
./deploy.sh --app=test --environment=staging --num=2 --size=t2.micro
The script above will output AWS ELB DNS address, which is where wordpress is hosted.
rm ansible-key* && terraform destroy terraform
DO NOT USE IN PRODUCTION THIS IS ONLY CREATED AS AN EXAMPLE.
- Create mysql db using AWS RDS.
- Create Dockerfile for wordpress app.
- Create ssl cert from AWS Certificate Manager and redirect to https.
- Create route53 dns and point to ELB.
- Use autoscalling groups instead of plain ec2