AWS CodePipeline
Cloud service · AWS · Updated

AWS CodePipeline

In short

AWS CodePipeline is a continuous integration and continuous delivery (CI/CD) service for fast and reliable application and infrastructure updates.

Cloud Services Hub →

10 key features of AWS CodePipeline

AWS CodePipeline offers an automated, flexible, and scalable CI/CD service that integrates well with AWS and third-party services, prioritizing fast delivery, security, and high availability.

01
Continuous Integration and Delivery

AWS CodePipeline automates the build, test, and deploy phases of your release process every time there is a code change, based on the release model you define.

02
Fast Delivery

Speed up the release process by automating the build and deployment phases, allowing for rapid delivery of features and updates.

03
Scalable

AWS CodePipeline can scale automatically to accommodate the growth of projects as they evolve over time, handling an increase in workloads seamlessly.

04
Flexible

Easily integrate with third-party services such as GitHub or integrate with custom plugins, providing flexibility in the tools and services you can use for your CI/CD processes.

05
Integrated with AWS Services

CodePipeline is deeply integrated with other AWS services like AWS CodeBuild, AWS CodeDeploy, Amazon EC2, and Amazon S3, offering a seamless CI/CD experience within the AWS ecosystem.

06
Secure

AWS CodePipeline is designed with security in mind, providing strong access control policies and allowing for encryption of data using AWS Key Management Service (KMS).

07
High Availability

AWS CodePipeline is designed for high availability and fault tolerance, ensuring that the CI/CD process remains operational and efficient without significant downtime.

08
Manual Approval Gates

Manual approval actions can prevent changes from progressing through a pipeline and can be included in any stage except a source stage.

09
Pipeline Monitoring and Recovery

Review real-time pipeline status, inspect alerts and source revisions, retry failed stages or actions, and manually rerun pipelines.

10
Pipeline Execution History

View pipeline execution history, including start and end times, run duration, and execution IDs.

Where AWS CodePipeline is used

AWS CodePipeline facilitates automated Continuous Integration/Continuous Delivery (CI/CD) processes for a variety of applications, from microservices and serverless architectures to infrastructure provisioning and complex deployment strategies, ensuring rapid, reliable, and high-quality software releases.

  1. 01
    Continuous Integration and Delivery for Microservices

    AWS CodePipeline automates the steps required to release new versions of microservices, integrating code changes, building the application, running automated tests, and deploying the code to various environments such as staging and production. This use case highlights the ability to manage complex architectures and multiple deployments in a streamlined process.

  2. 02
    Automated Deployment for Serverless Applications

    Leverage AWS CodePipeline to automate deployment processes for serverless applications built on AWS Lambda, Amazon API Gateway, and other serverless services. This involves automating the build, test, and deploy phases for applications where server management is abstracted away, ensuring rapid delivery with less overhead.

  3. 03
    Blue/Green Deployments

    Use AWS CodePipeline to implement blue/green deployment strategies, which minimize downtime and risk by running two identical production environments termed as 'Blue' and 'Green'. CodePipeline automates the process of deploying and testing the new version in the 'Green' environment before moving traffic from 'Blue' to 'Green', facilitating easy rollbacks if issues are detected.

  4. 04
    Infrastructure as Code (IaC) Deployments

    AWS CodePipeline integrates with AWS CloudFormation and other IaC tools to automate the deployment and updates of infrastructure. This ensures that the provisioning of AWS resources and the deployment of applications can be done in a consistent, repeatable manner across different environments, improving efficiency and reducing the chances for human error.

  5. 05
    Automated Testing and Quality Assurance

    Automatically trigger the execution of tests, including unit tests, integration tests, and UI tests, as part of the CI/CD process. This use case emphasizes the role of AWS CodePipeline in ensuring that every code change is verified, ensuring a high quality of code and quick identification of bugs or integration issues before they reach production.

How AWS CodePipeline is priced

AWS CodePipeline employs a pricing model based on the number of active pipelines per month, with additional costs for artifact storage and transfer.

Per-active Pipeline Pricing

V1 pipelines cost $1.00 per active pipeline per month, with one active V1 pipeline free per month. An active pipeline has existed for more than 30 days and has at least one code change run through it during the month. Pipelines are free for their first 30 days, and pipelines with no new code changes running through them during the month are not charged. Active pipeline charges are not prorated for partial months.

Artifact Storage and Transfer Pricing

Additional charges apply for artifact storage and the transfer of artifacts out of AWS CodePipeline to another region or out of AWS. These costs are based on the amount of data stored and transferred.

V2 Action Execution Pricing

V2 pipelines cost $0.002 per action execution minute, with each action's duration rounded up to the nearest minute. Manual approval and custom action types are excluded from these charges. The free tier includes 100 action execution minutes per month shared across all V2 pipelines in the account; unused minutes do not carry over.

Services AWS CodePipeline works with

AWS CodeBuildAWS CodeBuild

CodePipeline integrates with CodeBuild, a fully managed build service that compiles source code, runs tests, and produces software packages. CodeBuild can be used as a build stage in your pipeline to automate the build process.

AWS CodeDeployAWS CodeDeploy

CodePipeline integrates with CodeDeploy, a service that automates code deployments to various compute services, such as Amazon EC2, AWS Lambda, and on-premises servers. This integration allows you to use CodeDeploy as a deployment stage in your pipeline.

Amazon S3Amazon S3

CodePipeline can use S3 as a source or artifact store. You can configure CodePipeline to retrieve source code or deployment artifacts from S3 buckets or store build artifacts in S3 for further stages.

AWS LambdaAWS Lambda

CodePipeline can integrate with Lambda to perform custom actions or trigger functions at any stage of the pipeline. This allows you to add custom logic, notifications, or other automated processes as part of your CI/CD workflow.

AWS CloudFormationAWS CloudFormation

CodePipeline integrates with CloudFormation to automate the deployment of infrastructure as code. You can use CloudFormation templates as part of your pipeline to create, update, or delete AWS resources in a controlled and repeatable manner.

AWS CodeCommitAWS CodeCommit

A fully managed source control service that makes it easy for teams to host secure and scalable Git repositories.

Amazon CloudWatchAmazon CloudWatch

CodePipeline publishes pipeline execution metrics to CloudWatch for monitoring and alarms. Pipeline stage conditions can also evaluate CloudWatch alarms to block a release or initiate a rollback when application health deteriorates.

What is AWS CodePipeline

3 min read

AWS CodePipeline is a fully managed continuous integration and continuous delivery (CI/CD) service that automates the steps required to release software changes quickly and reliably. This service connects various stages involved in the software release process, such as building code, running tests, and deploying it to production environments, using a model defined in a pipeline. 

A pipeline in AWS CodePipeline is essentially a workflow that defines how code changes are to be promoted through various stages from source control to production. It is composed of a series of stages, each designed to perform specific actions on the code. Stages in a pipeline are typically categorized into source, build, test, and deploy, although users can customize this to suit their project needs. 

A stage's inbound transition can be disabled to prevent executions from entering that stage and enabled to let them continue. If multiple executions reach a disabled transition, only the latest continues when the transition is enabled; newer executions supersede waiting executions.

The default quota is 1,000 pipelines per AWS account per Region, counting pipelines that use either polling or event-based change detection.

CodePipeline offers V1 and V2 pipeline types, which differ in features and price. Pipelines default to V1 when no type is specified; V2 must be explicitly configured.

Each stage consists of one or more actions, which are tasks performed on the code within the stage. Actions can include tasks such as compiling code, running unit tests, or deploying code to a specific environment. 

Actions within a stage can run in series or in parallel.

Manual approval actions have an account-level default timeout of seven days. An individual action can override this with a timeout from five minutes to 86,400 minutes (60 days); otherwise, the account-level default applies.

One of the key features of AWS CodePipeline is its integration with other AWS services and third-party tools. For instance, it can automatically pull source code from repositories like GitHub, AWS CodeCommit, or Bitbucket. For building and testing code, it integrates seamlessly with AWS CodeBuild; for deploying code, it integrates with AWS CodeDeploy. 

Additionally, it supports integration with Jenkins, a popular open-source automation server, enabling developers to use existing Jenkins-based workflows within their pipelines. This wide range of integrations provides users with flexibility in building their CI/CD workflows and allows them to leverage existing tools and services in their development ecosystem. AWS CodePipeline also provides automated triggers for pipeline execution. These triggers can be configured to automatically start a pipeline based on specific events, such as a commit to a source repository or a change in a particular branch. This feature ensures that the software release process remains streamlined, with minimal manual intervention required, leading to faster and more frequent deployments. 

A specific pipeline execution can be stopped from continuing through the pipeline.

Security in AWS CodePipeline is handled with AWS Identity and Access Management (IAM), which controls access to the service and its resources. Users can set granular permissions for each action within a pipeline, ensuring that only authorized persons can make changes to the pipeline or the code. Moreover, the service is designed to keep your code and data secure throughout the release process, using encryption to protect your artifacts stored in S3 buckets and encrypting data in transit. 

Overall, AWS CodePipeline offers a robust solution for automating the software release process, making it faster, more reliable, and secure. Its ability to integrate with a wide array of AWS and third-party services, coupled with its automated execution triggers and security features, make it an attractive choice for developers and businesses looking to streamline their CI/CD workflows.

Concepts related to AWS CodePipeline

AWS CodePipeline exam questions

Real practice exam questions on AWS CodePipeline, with the correct answer and its explanation. Answer them with every option in the exam simulator.

AIF-C01

A company is preparing an ML-powered application for production. Each change to the application's inference code must follow the same release process: run automated tests, stop the release if any test fails, and obtain approval from the ML team before deploying to production. The company wants to minimize manual coordination between these steps. Which solution best meets these requirements?

Show answerCORRECT ANSWER

Use AWS CodePipeline with sequential stages for automated tests, manual approval, and production deployment, preventing progression when tests fail.

AWS CodePipeline orchestrates a repeatable CI/CD workflow. Failed tests block progression, and a manual approval stage ensures that the ML team authorizes the release before production deployment. Human approval is compatible with continuous delivery.

MLA-C02

A company fine-tunes a foundation model in Amazon Bedrock in a development AWS Region. An AWS CodePipeline release pipeline evaluates each custom model and records its ARN in an immutable release manifest. Production must run in a different Region in the same AWS account and must use the exact evaluated model without retraining. The selected model supports cross-Region custom model copying, and inference requires Provisioned Throughput in both Regions. The production application uses a regional Bedrock Runtime client.

Which deployment procedure should the ML engineer automate?

Show answerCORRECT ANSWER

Call CreateModelCopyJob in the production Region with the release manifest's custom model ARN and source Region. Wait for the copy to complete, create Provisioned Throughput for the resulting target model ARN, and wait until it is InService. Record the destination identifiers in the release record and configure production to invoke the destination provisioned model ARN.

Cross-Region custom model copying transfers the evaluated model without retraining. Using the manifest's exact source ARN preserves release identity. Waiting for copying and provisioning to finish ensures readiness, and invoking the destination provisioned model ARN serves the copied model in the required Region.

SAP-C03

A company uses an AWS CodePipeline V2 pipeline in PARALLEL execution mode to validate changes in an existing AWS CodeCommit repository. An Amazon EventBridge rule invokes a Lambda function for each update to the main branch. The function calls StartPipelineExecution. Source polling and other automatic pipeline triggers are disabled.

During bursts of commits, multiple executions sometimes validate the same newer commit instead of the individual commits that caused their events. The pipeline's CodeBuild actions consume only the source artifact produced by the CodeCommit source action, which is named RepositorySource.

The company must validate the exact commit identified in each branch-update event, even if the branch advances before the source action starts. The repository, parallel execution mode, and artifact-based build process must remain unchanged.

Which change should a solutions architect make?

Show answerCORRECT ANSWER

Modify the Lambda function to include a sourceRevisions entry in StartPipelineExecution with actionName set to RepositorySource, revisionType set to COMMIT_ID, and revisionValue set to the commit ID from the event.

A source revision override explicitly binds the source action to the event's commit ID. This is necessary because a CodeCommit source action in PARALLEL mode otherwise clones HEAD when the source action starts, which can be newer than the commit that triggered the execution.

Practice AWS CodePipeline in a full exam

Questions on AWS CodePipeline in each practice exam, with every answer option and an explanation for each:

Start a free practice exam

Learn AWS CodePipeline in lessons

23 short lessons on AWS CodePipeline in 8 certification courses.

and 17 more lessons

Open the lessons

AWS architecture icons are the property of Amazon Web Services. BlowStack is not affiliated with or endorsed by AWS.