Creating a CI/CD pipeline with CloudFormation and CodePipeline
Before we begin creating the pipeline, let's revise what a CI/CD pipeline actually is. Any CI/CD pipeline (in terms of software development) consists of stages.
Those stages are usually as follows (we will practice all of these steps later):
- Pre-build: Pull the code from source code management and install the dependencies.
- Build: Run the build and retrieve the artifacts.
- Test: Run a test suite against the build.
- Package: Store the build artifacts in the artifact storage.
- Deploy: Deploy a new version on the environment.
If any of these steps fail, the build system will trigger an error.
So, how can we apply the same steps on CloudFormation? Usually, it depends on the Continuous Integration (CI) system. In our case, these stages will do the following:
- Pre-build: Store the code (for example, the templates) in AWS CodeCommit and use AWS CodeBuild as a build system. We will...