AWS CodePipeline
A fully managed CI/CD service that detects source code changes and automatically executes build, test, and deploy stages, enabling complete automation of the release process
Overview
AWS CodePipeline is a fully managed continuous delivery (CD) service that automates the software release process. You define a pipeline combining source stages (CodeCommit, GitHub, S3, ECR), build stages (CodeBuild), test stages, and deploy stages (CodeDeploy, CloudFormation, ECS, S3), and the pipeline automatically executes whenever code changes are committed. V2 pipelines offer pipeline-level variables, Git tag triggers, improved manual approval stages, and other enhancements for building more flexible workflows.
Pipeline Structure and Stages
A CodePipeline pipeline consists of multiple stages. Each stage contains one or more actions, which can execute sequentially or in parallel. A typical pipeline follows this structure: Source (fetch code) -> Build (compile and test) -> Deploy to Staging -> Manual Approval -> Deploy to Production. The manual approval stage serves as a gate for human review before production deployment. SNS notifications send emails to approvers, who then approve or reject the action. The execution history of every pipeline run is recorded, allowing you to review the success/failure status, execution time, and artifact information for each stage.
Integration with CodeBuild and CodeDeploy
CodeBuild is a fully managed build service where you define build commands in a buildspec.yml file. It handles Docker image builds, unit test execution, static analysis, and artifact generation. The build environment uses disposable containers, providing a clean environment for each build. CodeDeploy automates deployments to EC2, ECS, and Lambda. For EC2 deployments, you can choose from three strategies: rolling update, Blue/Green deployment, and in-place deployment. For ECS deployments, Blue/Green deployment is recommended, gradually shifting traffic to the new task set and automatically rolling back if issues are detected. The corresponding Azure service is Azure DevOps Pipelines, which provides similar CI/CD pipeline capabilities.
Practical Usage Patterns
The most common practical use of CodePipeline is automating microservice deployments. Define an independent pipeline for each microservice so that services can be deployed independently. Combining with CloudFormation lets you deploy both application code and infrastructure changes through the same pipeline. Cross-account deployment is also supported, enabling you to build pipelines that build artifacts in a development account and deploy them to staging and production accounts. CodePipeline pricing for V2 pipelines is $1 per month plus pay-per-action-execution charges. To learn CodePipeline from basics to advanced topics, books (Amazon) offer a structured learning path.