-
What have you done?
provision IAC on AWS with [
Terrafrom
,Packer
,Ansible
] forWordpress
usingECS and RDS
-
How did you run your project?
- First run
Packer
withAnsible
to createGolden image
ofEC2 Wordpress
- Run
Terrafrom
to launch and release service.
- First run
-
What are the components interacting with each other?
Ansible
interacting betweenPacker
andTerrafrom
for this topology.
-
What problems did you encounter?
- no previous experience on
Terrafrom
andPacker
, so I took courses for both tool and based on that I created theIaC
for this repo.
- no previous experience on
-
How would you have done things to have the best HA/automated architecture?
-
Share with us any ideas you have in mind to improve this kind of infrastructure.
if the final goal to use
Wordpress
as static site, I prefer to convert thewordpress
to static website using plugin or script, then upload it toS3
If the WordPress will be used as main website or all the operations, I will create auto scale group with two node behand load balancer with
EFS
between nodes. and maybe if required creatinglambda function
withevent bridge
to to advance health-check and based on the result it will take action to guaranty the availability
-
Tomorrow we want to put this project into production. What would be your advice and choices to achieve that?
- For the high avaliablty ECS will automatically recover unhealthy containers to ensure from desired number of containers.
- monitoring: by using newrelic to monitor the app health and performance without complex configration, and for the logs cloudwatch.
- Database should be Aroura Mysql DB.
- Add EFS for shared media.
To apply the infrasture follow the below command
#Make sure to update variables.tf
cd Terrafrom
terraform init
terraform fmt .
terraform validate
terraform plan
terraform apply --auto-approve
cd WP
packer init .
packer build .
#Make to to update var -> variables.pkr.hcl