I originally developed this script in bash for a GoCD pipeline. The intention of the script is to decommission instances in batch whilst generating a final snapshot. For those of you that wonder why is Terraform not being used? (You know who you are) Good question. Not everyone is using Terraform yet and refactoring/importing deployment methods will incur costs which some clients are not prepared to pay.
Why change it? The move to Python was a logical one for me, it removes any OS dependency and I also see this as good excuse to practice my Python.
Terraform, AWS and WordPress – Part II
This is a continuation of Terraform, AWS and WordPress - Part I. Let look deeper under the covers and focus on what the bootstrap part of the deployment is doing.
user_data Just as a refresher, the userdata defined on an AWS EC2 instance is used to run commands or scripts on the instance when deployed. As we are deploying an Amazon Linux EC2 instance the commands will reflect this Operating System.
Setting the scene So lets carve the user_data into something we can read and work with and pop some remarks in.
First! Terraform, AWS and WordPress - Part I
Well here we go then, where to start? It seemed only fitting that the first post covers the fun I had setting up this WordPress server and site. I looked around at some of the options available, payed hosting etc and decided that “hey, lets learn something and share the experience at the same time”. Rather than manually setting up and configure the server (easy), I decided to try automate it as much as possible.