The brief
Set up and run production hosting on AWS for a WordPress website, with deployments that are repeatable and don’t depend on someone logging into a server.
The setup
- EC2 application servers behind an Elastic Load Balancer, so traffic only reaches healthy instances.
- A managed RDS database, with backups and maintenance handled by the platform.
- Bitbucket Pipelines and AWS CodeDeploy for deployments: code merged through a pull request is built and rolled out the same way every time.
Running it
Setting up hosting is the easy part; maintaining it is the job. That includes knowing what to do when a deployment fails halfway, such as safely cleaning up the instances and Auto Scaling groups a failed CodeDeploy rollout leaves behind, and documenting those procedures so the next person isn’t working it out under pressure.
Principles
- Nobody deploys by hand to production.
- Application servers are replaceable; data lives in managed services.
- Every recovery procedure is written down before it’s needed.
- Access is granted through IAM roles rather than shared credentials.