We began by moving from ECS on a single EC2 instance to ECS Fargate. This makes the platform entirely scalable as it doesn’t rely on a single host—Fargate removes the need to provision and manage servers, lets you specify and pay for resources per application, and improves security through application isolation by design.
We implemented a new deployment pipeline with AWS Code* which helps automate release pipelines for fast and reliable application and infrastructure updates.
Finally, we moved Canopy from RDS on to Aurora with autoscaling, further allowing them to scale based on demand. Aurora delivers up to 5X the throughput of standard MySQL running on the same hardware, and enables existing MySQL applications and tools to run without requiring modification. Its high availability and scalability made it an obvious choice for Canopy.
We created a centralised API for Canopy using AWS API Gateway, which was necessary in order for Canopy to have integration with third-party companies. We created the API Gateway resources by using Terraform (with the AWS provider), along with an OpenAPI template file to provision the specification of the API—this provided an example health check to their backend system. Canopy wanted to use API Gateway as a means of replacing their current setup with Service Gateway, hosted outside of AWS from their legacy platform.
We orchestrated a CodePipeline pipeline which allows Canopy developers to update the API template without having to run Terraform themselves. Developers from Canopy simply need to make the required changes to the template file and push this to the git repository. The pipeline is then triggered and updates the API specification accordingly. The process exists for both their staging API and their production API.
We also allowed the use of API keys to be distributed and controlled by Terraform. We gave Canopy developers the required documentation and training in order to create an API Key resource and distribute this to their teams. The running of Terraform is again handled by Terraform.
The platform was built from the ground up with infrastructure as code. Changes are recorded in version control which eases rollback and allows for easier collaborative working. Once the initial environment is deployed it is much easier to duplicate additional similar (or identical) environments. IaC results in much better consistency—we can prevent drift between environments we expect to be the same, and ensure environments are maintained in the state we expect.