AWS CodePipeline (CI/CD Pipeline)

Basics of AWS CodePipeline

Integrations

Discover how AWS CodePipeline orchestrates your CI/CD pipeline by integrating with AWS services and third‐party tools at each stage—Source, Build, Test, Deploy—and by adding optional Approvals & Invocations.

Pipeline Stages Overview

A robust CI/CD pipeline typically follows four core stages:

  1. Source – Pull code or artifacts from repositories
  2. Build – Compile, package, and run unit tests
  3. Test – Execute integration or specialized tests
  4. Deploy – Release assets to production environments

You can also insert Approvals or Invocations anywhere in the flow to meet compliance or automation requirements.

The image shows a slide titled "Additional Actions" with icons labeled "Approve" and "Invoke," alongside a simple flowchart with three colored dots connected by arrows.


1. Source Stage Integrations

CodePipeline supports multiple source providers, enabling you to trigger pipelines automatically when changes occur.

Source TypeIntegration MethodCommon Use Case
Amazon S3S3 Event NotificationsVersioned artifacts, static website
AWS CodeCommitNative Git RepositoryPrivate source control on AWS
Amazon ECRImage Push EventsContainer images for ECS/EKS
GitHub, BitbucketCodeStar ConnectionsPublic/third-party Git repositories

Amazon S3

Amazon S3 offers durable object storage with versioning and event-based triggers. Configure an S3 bucket event to start your pipeline whenever a new object arrives.

The image shows a green bucket icon at the center, surrounded by a dotted circle with a pink cloud search icon and an orange lambda icon.

AWS CodeCommit

Fully managed, scalable Git repositories with branch and commit history. CodePipeline hooks directly into CodeCommit branches for seamless source control.

Amazon ECR

Store and manage Docker container images. Use docker push to upload images—perfect when you deploy to Amazon ECS or EKS.

Third-Party Repositories

Link GitHub or Bitbucket via AWS CodeStar Connections. Grant repository access and select the branch to trigger your pipeline.

The image illustrates a DevOps CI/CD pipeline with AWS Cloud services (Amazon S3, AWS CodeCommit, Amazon ECR) and third-party tools (GitHub, Bitbucket). It shows the stages of Source, Build, Test, Deploy in a continuous loop.


2. Build Stage Integrations

Compile your application, run unit tests, and package artifacts using either AWS-managed or external CI tools.

ProviderServiceHighlights
AWS CodeBuildFully managedAuto-scaling, buildspec support
JenkinsSelf-managedAWS CodePipeline plugin & IAM roles
TeamCityOn-prem/CloudCustom agent pools
CloudBeesSaaSPipeline as code

AWS CodeBuild

A fully managed CI service that scales continuously. Define your build commands in a buildspec.yml.

version: 0.2
phases:
  install:
    commands:
      - echo Installing dependencies
  build:
    commands:
      - npm install
      - npm run build
artifacts:
  files:
    - '**/*'

The image illustrates a DevOps lifecycle with a focus on the "Build" phase, highlighting AWS CodeBuild as a fully managed service that compiles, runs tests, and produces artifacts.

Note

Ensure your CodeBuild service role has permissions to pull source and write artifacts to S3 or Amazon ECR.


3. Test Stage Integrations

Depending on your workflow, combine testing with build or use dedicated test platforms.

Combined Build/Test
Run unit and integration tests within CodeBuild, Jenkins, TeamCity, or CloudBees.

Dedicated Test Tools

  • AWS Device Farm for mobile and web app testing
  • Third-party services: BlazeMeter, RunScope, Micro Focus, Ghost Inspector

The image shows a DevOps lifecycle diagram with stages like Source, Build, Test, and Deploy, alongside logos for AWS Device Farm and third-party tools like Runscope, BlazeMeter, MicroFocus, and Ghost Inspector.


4. Deploy Stage Integrations

Target servers, serverless environments, containers, or static sites with flexible deployment actions.

Target TypeAWS ServiceThird-Party Example
Static WebsitesAmazon S3 + CloudFront
EC2 & On-PremiseAWS CodeDeployXebiaLabs
ContainersAmazon ECS / EKS
ServerlessAWS Lambda + API Gateway
Full StackElastic Beanstalk, OpsWorks

Key AWS Deployment Services

  • Amazon S3: Host static sites and assets
  • AWS CodeDeploy: Blue/green and in-place deployments
  • Elastic Beanstalk: Automated provisioning & scaling
  • AWS OpsWorks: Chef-based server configurations
  • CloudFormation, Service Catalog, AppConfig, Alexa Skills

The image shows a DevOps lifecycle diagram with CI/CD stages and a list of AWS Cloud services, including Amazon S3 and AWS CodeDeploy, alongside a third-party service, XebiaLabs.


5. Additional Actions: Approvals & Invocations

Beyond core stages, incorporate approvals or invoke custom logic as needed.

Manual Approvals

Use Amazon SNS or AWS Chatbot to notify stakeholders. Approvers click an action in the AWS Console or via email/SMS to proceed.

The image shows a diagram labeled "Approvals" with a section for "AWS Cloud" featuring the Amazon Simple Notification Service (SNS) logo and text.

Warning

Configure your SNS topics and endpoints carefully to avoid spamming recipients.

Automated Invocations

Trigger AWS Lambda functions or Step Functions to run custom validations, security scans (e.g., Snyk), or complex orchestrations.

The image shows a diagram labeled "Invocations" with two sections: "AWS Cloud" featuring AWS Lambda and AWS Step Functions, and "Third Party" featuring Snyk.


By mixing and matching AWS services and third-party tools, you can tailor CodePipeline to fit any CI/CD workflow—from simple static sites to complex microservices architectures.


Watch Video

Watch video content

Previous
Use cases of AWS CodePipeline