A CI/CD pipeline on AWS with Jenkins, Ansible and Terraform
Infrastructure as code with Terraform and Ansible on AWS, and Jenkins pipelines that build and deploy a Python app on every GitHub change. A York University Cloud Operations project.
- York University · Cloud Operations
- 2024
- Engineer
- Terraform · Ansible · Jenkins · AWS · GitHub · Python
Infrastructure by hand does not scale
Clicking servers, networks and deploys together one step at a time is slow, hard to repeat and easy to get wrong. This York University Cloud Operations project set out to automate the whole path, from the AWS infrastructure to every release of the code that runs on it.
Three tools, one pipeline
- Terraform describes the AWS infrastructure as code and provisions it
- Ansible configures what Terraform creates
- Jenkins builds, tests and deploys the application whenever the code changes on GitHub
Built in three labs
Lab 1: automating AWS infrastructure with Terraform. Instead of creating resources step by step, the infrastructure is written as Terraform code and provisioned by running it, which saves time and makes the systems on AWS easier to manage.
Lab 2: provisioning and configuring with Terraform and Ansible. Terraform and Ansible together manage a more complex set of systems on AWS: one creates the infrastructure, the other configures it.
Lab 3: Jenkins pipelines. CI/CD pipelines for a Python program build it and put it into action automatically. Every change pushed to the GitHub repository triggers the pipeline, with no manual deploy.
From commit to running code
The result is a pipeline where a code change on GitHub flows through build and deploy on its own, on infrastructure that is defined, provisioned and configured as code. It is the same approach behind this site, where every push is tested, built and deployed by GitHub Actions.