What Is AWS CodePipeline? V1 vs V2 Pricing With Examples, GitHub to ECS Tutorial, Action Types and CodePipeline vs GitHub Actions

Logeshwaran
—

AWS CodePipeline is the AWS service that automates your software releases. You connect it to your code (GitHub, GitLab, Bitbucket, CodeCommit or an S3 bucket), and every time you push a change, it runs your release process in order: pull the code, build and test it (usually with CodeBuild), wait for approval if you want one, and deploy it to ECS, Lambda, EC2, EKS, Elastic Beanstalk, S3 or CloudFormation, stopping and rolling back if a step fails. There are two pipeline types. V2, the default today, costs $0.002 per action execution minute with 100 free minutes a month, and adds triggers on branches, tags and file paths, variables, parallel and queued runs, and automatic rollback. V1 costs $1 per active pipeline per month, with one pipeline free. A small team's pipeline that runs 20 times a month typically costs well under $1 in CodePipeline charges, plus CodeBuild minutes for the build itself. Below: what CodePipeline is and how it works, V1 vs V2 with the break-even, every price with worked examples, a step-by-step tutorial from GitHub to production, every action type, CodePipeline vs GitHub Actions and Jenkins, quotas, and fixes for the errors you will meet first.

The furniture store's developer released new versions of the website the way many small teams do: on Friday afternoon, from his laptop, with a checklist taped to his monitor. Build the image, push it to ECR, update the ECS service, check the site, tell everyone. One Friday he skipped step three, the store ran last week's code for the whole weekend, and a sale price never went live. Ethan's suggestion was to stop releasing by hand. Jake, who had come to pick up the old monitor, read the checklist and asked: "If it's the same steps every time, why is a person doing them?"

⚡ Quick Answer

• What it is: a managed CI/CD pipeline that runs source, build, test, approval and deploy steps on every change. Explained.

• Price: V2 $0.002 per action minute (100 free a month); V1 $1 per active pipeline (1 free). Worked costs.

• Which type: V2 for new pipelines; V1 only for very busy pipelines on a flat fee. V1 vs V2.

• Start: connect GitHub, add a CodeBuild stage, add a deploy stage, push. Tutorial.

How it works · Action types · CodeBuild, CodeDeploy · vs GitHub Actions · Quotas · Errors · FAQ.

New to deploying on AWS? The cards below cover CodeBuild buildspec files, CloudFormation stacks, ECS, ECR and the iam:PassRole permission that every pipeline needs.

🧭 NEW HERE? READ THESE FIRST

These five pages explain the pieces a CodePipeline release uses:

📌 Bookmark this; the pricing examples, the action table and the error fixes are the parts you will come back for.

What is AWS CodePipeline?

CodePipeline is a continuous delivery service: it turns your release checklist into an automated pipeline that runs the same way every time. A pipeline is a series of stages (for example Source, Build, Test, Approve, Deploy), each with one or more actions (pull code from GitHub, run a CodeBuild project, deploy to ECS). When something starts the pipeline, usually a push to your main branch, CodePipeline runs the stages in order, passes the output of each one (called an artifact) to the next, and stops if anything fails.

CodePipeline does not build or deploy anything by itself. It is the conductor: it calls other services to do the work, such as CodeBuild to compile and test, CodeDeploy or the ECS deploy action to release, and CloudFormation to change infrastructure, and it keeps track of what ran, what passed and what failed.

What you would use CodePipeline for:

  • Releasing web apps and APIs to ECS, Elastic Beanstalk, EC2 or Lambda on every merge.
  • Deploying infrastructure as code with CloudFormation or the CDK, with a manual approval before production.
  • Publishing static websites to S3 and refreshing CloudFront.
  • Building and pushing container images to ECR, then deploying them.
  • Multi-account releases: deploy to a test account, run tests, approve, then deploy to production in another account.

Jake: "So it's the checklist on the monitor, except the computer does it and never skips step three."

Ethan: "And when step three fails, it stops before step four and tells you which line broke."

How CodePipeline works, step by step

Here is what happens on a typical push to the main branch:

  1. A trigger fires. You push to GitHub; a webhook through AWS CodeConnections (formerly CodeStar Connections) tells CodePipeline about the change. V2 pipelines can filter triggers by branch, Git tag, pull request or changed file paths.
  2. An execution starts. CodePipeline creates a new pipeline execution with an ID, records the commit, and starts the first stage.
  3. Source stage: the source action downloads the code at that commit and saves it as a zip artifact in the pipeline's artifact store, an S3 bucket in your account.
  4. Build stage: a CodeBuild action reads the source artifact, runs the commands in your buildspec.yml (install, test, build, push an image), and saves its outputs as a new artifact.
  5. Test or approval stage (optional): automated tests run, or the pipeline pauses on a manual approval action until someone approves in the console or by email link.
  6. Deploy stage: the deploy action takes the build artifact and releases it, for example updating an ECS service with the new image or a CloudFormation stack with the new template.
  7. Success or failure: if every action succeeds, the execution is marked Succeeded. If one fails, the stage fails, later stages do not run, and on V2 pipelines you can configure the failed stage to roll back automatically to the last successful version.
  8. History: the console shows each execution, every action's logs and links to CodeBuild and the deployment, kept for 12 months.

CodePipeline V1 vs V2

 V2 (default)V1
Price$0.002 per action execution minute$1.00 per active pipeline per month
Free tier100 action minutes a month, shared by all V2 pipelines1 active pipeline a month
TriggersPush and pull request triggers with branch, tag and file path filtersEvery change on the configured branch
Execution modesSUPERSEDED, QUEUED or PARALLELSUPERSEDED only
Pipeline variablesYes, set at run timeNo
Stage conditions and automatic rollbackYesNo
New actions (Commands, EC2, EKS, Lambda deploy, Invoke)YesSome only

Execution modes, explained: in SUPERSEDED mode a newer execution can overtake an older one waiting at a stage, so only the latest change reaches production (good for most apps). QUEUED mode runs executions one after another in order, so every commit is released (good when each release must be deployed). PARALLEL mode runs executions independently at the same time (good for feature branches and pull request pipelines).

The break-even between V1 and V2: $1 a month buys 500 action minutes on V2. If a single pipeline uses fewer than 500 action minutes a month, V2 is cheaper (and has more features); if it runs constantly and uses more, V1's flat fee is cheaper. You can convert a V1 pipeline to V2 in the console with Edit, Pipeline type, and back again.

AWS CodePipeline pricing

  • V2 pipelines: $0.002 per action execution minute, rounded up to the next whole minute per action. Manual approval and custom actions are not billed. The first 100 minutes each month are free across all your V2 pipelines.
  • V1 pipelines: $1.00 per active pipeline per month, not prorated. A pipeline is active only if it is more than 30 days old and at least one code change ran through it that month, so new pipelines and idle months are free. One active V1 pipeline a month is free.
  • What else you pay for: CodeBuild build minutes for your build actions (for example $0.005 a minute for the general1.small Linux machine, with 100 free minutes a month), S3 storage for artifacts, KMS if you use a customer managed key, and the resources you deploy.

Note that a CodeBuild action counts twice: its duration is billed as CodePipeline V2 action minutes and as CodeBuild build minutes. Both are small, but on long builds the CodeBuild part is usually the bigger number.

Worked examples: what CodePipeline costs

Example 1: the furniture store's website pipeline (V2). Source (1 minute), Build with CodeBuild (5 minutes), Deploy to ECS (3 minutes): 9 action minutes per run, 20 runs a month.

  • Action minutes: 20 x 9 = 180; minus 100 free = 80 x $0.002 = $0.16
  • CodeBuild: 20 x 5 = 100 build minutes on general1.small, inside the 100 free minutes = $0
  • Artifacts in S3: a few hundred megabytes, about one cent
  • Total: about $0.17 a month, to never skip step three again

Ethan: "Seventeen cents a month. The weekend of wrong prices cost more than ten years of this."

Jake: "So the robot's cheaper than the sticky note."

Example 2: a team with ten busy pipelines (V2). Each runs 60 times a month with 15 action minutes per run: 10 x 60 x 15 = 9,000 minutes; minus 100 free = 8,900 x $0.002 = $17.80 a month. On V1, the same ten pipelines would cost 9 x $1 = $9.00, because each one uses 900 minutes, well past the 500-minute break-even. If those pipelines need none of V2's features, V1 is cheaper; most teams keep V2 for the triggers and rollback.

Example 3: a production approval that waits a weekend. A pipeline pauses at a manual approval from Friday evening to Monday morning. The approval action is free on V2, so the wait costs nothing; you pay only for the minutes the other actions run.

Example 4: 100 rarely used V1 pipelines. Only pipelines with a code change that month count as active. If 12 of them ran in October, the bill is (12 - 1 free) x $1 = $11, not $99.

Example 5: a long build. A Java build that takes 25 minutes on a general1.medium machine ($0.01 a minute) and runs 200 times a month: CodeBuild 200 x 25 x $0.01 = $50, and CodePipeline action minutes 200 x 25 x $0.002 = $10 (plus the other actions). Speeding up the build with caching cuts both lines at once.

CodePipeline tutorial: from GitHub to production

This builds the store's pipeline: a GitHub repository with a Dockerfile, built by CodeBuild, pushed to ECR and deployed to an existing ECS service.

  1. Prepare the build: add a buildspec.yml to your repository (below) that logs in to ECR, builds and pushes the image, and writes an imagedefinitions.json file naming the container and new image. Our buildspec guide covers the file's format.
  2. Create the CodeBuild project with privileged mode on (needed to build Docker images) and a service role allowed to push to your ECR repository.
  3. Open the CodePipeline console and choose Create pipeline, then Build custom pipeline. Name it, keep V2 and Superseded mode, and let it create a new service role.
  4. Source: choose GitHub (via GitHub App), then Connect to GitHub to create a connection, install the AWS Connector app on your GitHub account, and pick the repository and branch. Leave the output format as the default zip.
  5. Trigger: keep push events on the main branch, or add file path filters (for example only files under the src folder) so documentation changes do not trigger releases.
  6. Build: choose AWS CodeBuild and your project.
  7. Deploy: choose Amazon ECS, your cluster and service, and the image definitions file name imagedefinitions.json.
  8. Create the pipeline. It runs immediately on the latest commit; watch each stage turn green.
  9. Add an approval (optional): edit the pipeline, add a stage before Deploy with a Manual approval action and an SNS topic to notify approvers.
  10. Turn on rollback: on the Deploy stage, set the failure behavior to roll back, so a failed deployment returns the service to the last good release.
version: 0.2
phases:
  pre_build:
    commands:
      - aws ecr get-login-password --region $AWS_DEFAULT_REGION | docker login --username AWS --password-stdin $REPO_URI
      - IMAGE_TAG=$(echo $CODEBUILD_RESOLVED_SOURCE_VERSION | cut -c 1-7)
  build:
    commands:
      - docker build -t $REPO_URI:$IMAGE_TAG .
      - docker push $REPO_URI:$IMAGE_TAG
  post_build:
    commands:
      - printf '[{"name":"web","imageUri":"%s"}]' $REPO_URI:$IMAGE_TAG > imagedefinitions.json
artifacts:
  files:
    - imagedefinitions.json

Here REPO_URI is an environment variable on the CodeBuild project set to your ECR repository's URI, and web must match the container name in your ECS task definition exactly; a mismatch is the most common reason the ECS deploy action fails. If you deploy to ECS often, our ECS deployment stuck guide explains what to check when a rollout does not finish.

From the AWS CLI you can start a run, check its status or export the pipeline's definition to keep in version control:

aws codepipeline start-pipeline-execution --name store-web
aws codepipeline get-pipeline-state --name store-web \
  --query "stageStates[].[stageName,latestExecution.status]" --output table
aws codepipeline get-pipeline --name store-web > store-web-pipeline.json

CodePipeline with GitHub, in detail

GitHub is the most common source for CodePipeline, and the connection is where most first-time setups stall:

  • Use the GitHub App connection (shown as "GitHub (via GitHub App)"), created through CodeConnections. The older "GitHub (via OAuth app)" source action used a personal access token and polling; it still works for old pipelines but should be migrated.
  • Who approves it: installing the AWS Connector app on a GitHub organization needs an organization owner, or approval of the request. If your connection stays Pending, ask your GitHub admin to approve the app installation, then choose Update pending connection in the AWS console.
  • Repository access: you can give the app access to all repositories or selected ones; a pipeline fails to find a repository the app was not given.
  • One connection, many pipelines: create the connection once per GitHub account or organization and reuse its ARN in every pipeline.
  • Pull request pipelines: V2 triggers can start on pull requests opened or updated against chosen branches, usually with PARALLEL execution mode, so each pull request gets its own test run.
  • Monorepos: use file path filters so the pipeline for the web app runs only when files under the web folder change, and the API's pipeline only when files under the api folder change.
  • Full clone: the default source output is a zip of the files; choose the full clone option if your build needs Git history (for example to compute versions from tags), which gives CodeBuild access to the repository through the connection.

Three more example pipelines

  • Static website: GitHub source, a CodeBuild stage that runs npm ci and npm run build, an Amazon S3 deploy action with "Extract file before deploy" pointing at your website bucket, and a Commands action that runs aws cloudfront create-invalidation so visitors see the new version immediately. Typical cost: cents a month.
  • Serverless API: GitHub source, a CodeBuild stage that runs tests and packages the app with SAM or the CDK, a CloudFormation deploy action that creates a change set, a manual approval, and a second CloudFormation action that executes the change set, so you see exactly what will change before it does.
  • Infrastructure only: a Terraform or CDK repository as source, a build that runs terraform plan or cdk diff and saves the plan, an approval that shows the plan's summary, and a final build that applies it, giving infrastructure changes the same review and audit trail as application code.

Jake: "So my website could do this too? I change a price, push, and it's live?"

Ethan: "In about two minutes, for a few cents a month. And if you break the page, the pipeline puts the old one back."

CodePipeline action types

  • Source: GitHub, GitHub Enterprise Server, GitLab and Bitbucket through CodeConnections; AWS CodeCommit; Amazon S3 (a zip file in a bucket); Amazon ECR (a new image tag).
  • Build: AWS CodeBuild (the usual choice), Jenkins, and the Commands action, which runs shell commands on managed CodeBuild compute without you creating a CodeBuild project (with a 55-minute timeout and access to Secrets Manager secrets).
  • Test: CodeBuild, Device Farm, and third-party testing tools.
  • Deploy: Amazon ECS (rolling), ECS blue/green through CodeDeploy, Amazon EC2 (a native action that deploys to instances behind a load balancer), Amazon EKS, AWS Lambda (with linear or canary traffic shifting and alarm-based rollback), Elastic Beanstalk, CloudFormation and CloudFormation StackSets, Amazon S3, CodeDeploy for EC2 and on-premises servers, AWS Service Catalog and AWS AppConfig.
  • Approval: manual approval, with an optional SNS notification, a comment, and a timeout up to 60 days (7 days by default). Free on V2.
  • Invoke: a Lambda function, a Step Functions state machine, or another pipeline, passing variables and source revisions between pipelines, even across accounts.
  • Security scanning: the Amazon Inspector scan action checks source code or container images for vulnerabilities and can fail the pipeline above a severity you choose.

For CloudFormation deploy actions, remember the artifact limit of 256 MB and the 1 KB limit on parameter overrides; large templates or many parameters belong in a template configuration file in the artifact instead.

CodePipeline, CodeBuild, CodeDeploy and CodeCommit: who does what

  • AWS CodeCommit: AWS's own Git hosting, an alternative to GitHub for the source stage.
  • AWS CodeBuild: runs builds and tests in fresh containers, billed per build minute; reads buildspec.yml.
  • AWS CodeDeploy: deploys to EC2 instances, on-premises servers, Lambda and ECS blue/green, with health checks and rollback.
  • AWS CodePipeline: orchestrates all of the above, and many other services, into one release process.
  • AWS CodeArtifact: a private package repository for npm, pip, Maven and NuGet packages your builds use.
  • AWS CodeConnections: the secure link between AWS and GitHub, GitLab or Bitbucket.
ToolIts jobBillingUse it alone when
CodePipelineOrchestrates source, build, test, approval and deployPer action minute (V2) or per active pipeline (V1)Never quite alone; it calls the others
CodeBuildRuns builds and tests in containersPer build minute by machine sizeYou only need builds and tests on each push
CodeDeployDeploys to EC2, on-premises, Lambda and ECS blue/greenFree for EC2, Lambda and ECS; small fee for on-premisesYou deploy from a script or CLI by hand
GitHub ActionsWorkflows next to your GitHub codeIncluded minutes in GitHub plans, then per minuteYour code and team live on GitHub
JenkinsSelf-hosted automation server with pluginsFree software; you pay for and run the serversYou need maximum control and already run it

You can use each on its own. CodeBuild alone can build on every push with webhooks; CodeDeploy alone can deploy from the CLI. CodePipeline is what you add when you want those steps chained, approved, visible and repeatable.

CodePipeline vs GitHub Actions, GitLab CI and Jenkins

  • CodePipeline vs GitHub Actions: GitHub Actions runs workflows next to your code, with a huge marketplace of reusable actions and runners included in GitHub plans. CodePipeline runs inside your AWS account with IAM roles instead of stored keys, native actions for AWS deployments, cross-account releases and approvals, and billing on your AWS invoice. Many teams combine them: GitHub Actions for tests on pull requests, CodePipeline for releases to AWS. If you use GitHub Actions for AWS deployments, connect it with OpenID Connect so it uses short-lived role credentials.
  • CodePipeline vs GitLab CI/CD: similar trade-off: GitLab CI is tightly integrated with GitLab repositories and merge requests; CodePipeline is AWS-native and works with GitLab as a source through CodeConnections.
  • CodePipeline vs Jenkins: Jenkins is self-hosted and endlessly flexible with plugins, but you run, patch and scale its servers. CodePipeline and CodeBuild are fully managed and scale to zero. Teams with large Jenkins setups often keep Jenkins for builds and let CodePipeline orchestrate releases, using the Jenkins action.
  • CodePipeline vs Elastic Beanstalk or App Runner deployments: those services can deploy for you with less setup; CodePipeline gives you control over every step, approvals and tests in between.

Is AWS CodePipeline deprecated?

No. CodePipeline is fully supported and actively developed; 2025 alone brought native EC2, EKS and Lambda deploy actions, the pipeline Invoke action and Commands action updates. The confusion comes from its neighbors in the "Code" family:

  • AWS CodeStar, a dashboard that set up projects with CodeCommit, CodeBuild and CodePipeline together, was discontinued in 2024. Projects it created kept their underlying pipelines, which still work. "CodeStar vs CodePipeline" is therefore no longer a choice: use CodePipeline directly, or define projects in CloudFormation or the CDK.
  • CodeStar Connections were renamed AWS CodeConnections; existing connections keep working under the new name, and some APIs and IAM actions still use the codestar-connections prefix.
  • AWS CodeCommit stopped accepting new customers in 2024, then returned to full availability for new customers in late 2025, so it is again an option for the source stage alongside GitHub, GitLab and Bitbucket.

If you read an older tutorial that starts with "Create a project in CodeStar," skip that step and create the CodeBuild project and pipeline yourself; the rest of the steps still apply.

CodePipeline logs: where to find what happened

  • Execution history: in the CodePipeline console, choose your pipeline and View history to see every execution, its trigger (which commit or manual start), its status and duration. History is kept for 12 months.
  • Action details: select a failed action to see its error message and a link to the underlying service, such as the CodeBuild build or the CloudFormation stack events.
  • Build logs: CodeBuild writes every build's output to CloudWatch Logs (and optionally S3); the build log is where most real errors are.
  • Deployment logs: ECS service events, CodeDeploy deployment events, CloudFormation stack events and Lambda logs, depending on your deploy action.
  • Events: CodePipeline publishes pipeline, stage and action state changes to EventBridge, which you can route to SNS, Slack or a log store for a permanent record beyond 12 months.
  • API activity: CloudTrail records who started, stopped, approved or changed a pipeline.

CodePipeline with Terraform and the CDK

You can define the pipeline itself as code, which is the best way to keep it reviewable and repeatable. In Terraform, the aws_codestarconnections_connection resource creates the GitHub connection (you still approve it once in the console), and aws_codepipeline defines the pipeline with an artifact store and one stage block per stage:

resource "aws_codepipeline" "web" {
  name          = "store-web"
  role_arn      = aws_iam_role.pipeline.arn
  pipeline_type = "V2"

  artifact_store {
    location = aws_s3_bucket.artifacts.bucket
    type     = "S3"
  }

  stage {
    name = "Source"
    action {
      name             = "GitHub"
      category         = "Source"
      owner            = "AWS"
      provider         = "CodeStarSourceConnection"
      version          = "1"
      output_artifacts = ["src"]
      configuration = {
        ConnectionArn    = aws_codestarconnections_connection.github.arn
        FullRepositoryId = "furniture-store/web"
        BranchName       = "main"
      }
    }
  }

  stage {
    name = "Build"
    action {
      name             = "Build"
      category         = "Build"
      owner            = "AWS"
      provider         = "CodeBuild"
      version          = "1"
      input_artifacts  = ["src"]
      output_artifacts = ["build"]
      configuration    = { ProjectName = aws_codebuild_project.web.name }
    }
  }

  stage {
    name = "Deploy"
    action {
      name            = "ECS"
      category        = "Deploy"
      owner           = "AWS"
      provider        = "ECS"
      version         = "1"
      input_artifacts = ["build"]
      configuration = {
        ClusterName = "store"
        ServiceName = "web"
        FileName    = "imagedefinitions.json"
      }
    }
  }
}

Note the provider name CodeStarSourceConnection, which kept the old name even after the rename to CodeConnections. In CloudFormation the resource is AWS::CodePipeline::Pipeline, written in YAML or JSON with the same stages and actions, and in the CDK the aws-codepipeline and aws-codepipeline-actions modules build the same thing in TypeScript or Python, or CDK Pipelines builds a self-updating pipeline for CDK apps. The pipeline's own structure is stored as JSON, which is what aws codepipeline get-pipeline returns.

From the CLI: the console's Release change button is the same as aws codepipeline start-pipeline-execution --name store-web, which reruns the pipeline on the latest commit. aws codepipeline list-pipelines lists every pipeline in the Region, get-pipeline exports a pipeline's definition, update-pipeline --cli-input-json file://pipeline.json applies an edited one, and list-pipeline-executions shows recent runs with their status, which is handy in scripts and chat bots.

Ethan: "The pipeline that releases the code is code too. If someone deletes it, we recreate it in a minute."

Jake: "Turtles all the way down."

A typical CodePipeline architecture

A production-grade setup for a containerized web app, described left to right: developers push to GitHub; a CodeConnections webhook triggers a V2 pipeline in a central tools account; the Source stage stores the commit in an encrypted S3 artifact bucket (with a customer managed KMS key shared with the other accounts); the Build stage runs CodeBuild to test the code, build the image and push it to ECR, with an Inspector scan action that fails on critical vulnerabilities; the Test stage deploys to an ECS service in a staging account through a cross-account role and runs integration tests; a manual approval notifies the product owner through SNS; the Production stage deploys the same image to ECS in the production account, with automatic rollback tied to CloudWatch alarms; and EventBridge sends every failure to the team's chat. Every piece is defined in Terraform or the CDK in its own repository.

Smaller teams start with three stages in one account, as in the tutorial, and add accounts, approvals and scans as the stakes grow.

AWS CodePipeline interview questions (with short answers)

  • What are stages, actions and artifacts? Stages are ordered steps of a pipeline, actions are the tasks inside a stage, and artifacts are the files passed between actions through S3.
  • What is the difference between V1 and V2 pipelines? Billing (flat per pipeline vs per action minute) and features: V2 adds trigger filters, variables, execution modes, stage conditions and rollback.
  • How do you deploy to multiple accounts? Cross-account roles for the deploy actions, plus a customer managed KMS key and bucket policy for the artifact bucket.
  • How do you add a human check before production? A manual approval action, optionally with SNS notifications.
  • What does SUPERSEDED mode mean? A newer execution can replace an older one waiting at a stage, so only the latest change is released.
  • How does CodePipeline connect to GitHub? Through AWS CodeConnections, using the AWS Connector GitHub app.
  • Where do you troubleshoot a failed build? In the CodeBuild build log in CloudWatch Logs, linked from the failed action.
  • How do you keep pipelines consistent across projects? Define them as code with CloudFormation, the CDK or Terraform.

CodePipeline quotas and limits

  • Pipelines: 1,000 per Region per account (adjustable); at most 300 of them may use polling for source changes, so use event-based change detection.
  • Stages: 2 to 50 per pipeline. Actions: 1 to 50 per stage, up to 1,000 per pipeline.
  • Concurrent executions: up to 50 per pipeline in QUEUED or PARALLEL mode.
  • Source artifact size: 7 GB from S3, 1 GB from CodeCommit or GitHub (512 MB for Elastic Beanstalk deployments, 256 MB for CloudFormation, 3 MB for ECS blue/green input).
  • Timeouts: CodeBuild actions 36 hours, CloudFormation actions 3 days, CodeDeploy actions 5 days, manual approval 7 days by default (configurable from 5 minutes to 60 days), Step Functions invoke 7 days, most other actions 1 hour.
  • Variables: up to 50 pipeline-level variables; triggers up to 50 per pipeline with up to 8 include and 8 exclude patterns per filter.
  • History: execution history is kept for 12 months.
  • Names: pipeline, stage and action names up to 100 characters, letters, numbers, periods, at signs, hyphens and underscores; no spaces.

Common CodePipeline errors and fixes

  • "Insufficient permissions" or "The provided role does not have permissions to perform this action": the pipeline's service role is missing a permission for the action (for example ecs:UpdateService, codebuild:StartBuild, or s3:PutObject on the artifact bucket). Add it to the role. Creating the pipeline also needs iam:PassRole, which our PassRole guide explains.
  • Source action fails with a connection error: the CodeConnections connection is still Pending. Open Settings, Connections in the console and complete the handshake with GitHub, GitLab or Bitbucket, then retry the stage.
  • "No branch named main was found": the branch in the source action does not exist or has a different name (master vs main). Fix the branch name in the source action.
  • The pipeline does not start on push: the trigger filters exclude the change (wrong branch, file path filter too narrow), or the pipeline is set to polling and has hit the 300 polling-pipeline limit. Check the trigger settings and switch to event-based detection.
  • Build stage fails: open the CodeBuild link from the failed action and read the build log. "COMMAND_EXECUTION_ERROR" means a command in your buildspec returned an error, as our COMMAND_EXECUTION_ERROR guide shows.
  • ECS deploy fails with "Exception while trying to read the image definitions file": the artifact does not contain imagedefinitions.json, the file name in the deploy action differs, or the JSON is malformed. Make sure the buildspec lists it under artifacts.
  • "The container name in the image definitions file does not match": the name in imagedefinitions.json must equal the container name in the task definition.
  • AccessDenied reading artifacts in another account: cross-account pipelines need a customer managed KMS key for the artifact bucket with a key policy that allows the other account's roles, plus a bucket policy granting access; the default AWS managed key cannot be shared.
  • CloudFormation action fails with "Template format error" or a size error: the template or parameter overrides exceed the 256 MB artifact or 1 KB override limits, or the template path in the action is wrong.
  • Execution "Superseded" and nothing deployed: a newer commit overtook it in SUPERSEDED mode, which is expected; use QUEUED mode if every commit must be released.

Best practices

  • Use V2 for new pipelines and event-based triggers, with file path filters so unrelated changes do not release.
  • Keep the pipeline definition in code with CloudFormation, the CDK or Terraform, not only in the console.
  • Add tests before deploy and a manual approval before production, at least at first.
  • Turn on stage rollback for deploy stages, and alarms on your service so failed releases are caught.
  • Deploy to a test environment first, ideally a separate account, then promote the same artifact to production.
  • Cache build dependencies in CodeBuild to cut build minutes.
  • Use least-privilege roles per pipeline, and a customer managed KMS key for artifacts in multi-account setups.
  • Send notifications for failures to chat or email through CodeStar Notifications or EventBridge, as our EventBridge explainer describes.

Frequently asked questions

What is AWS CodePipeline?

A managed AWS service for continuous delivery. It automates your release process as a pipeline of stages, such as source, build, test, approval and deploy, and runs it every time your code changes.

How much does AWS CodePipeline cost?

V2 pipelines cost $0.002 per action execution minute, with 100 free minutes a month. V1 pipelines cost $1 per active pipeline per month, with one free. CodeBuild minutes, S3 artifact storage and deployed resources are billed separately.

Is AWS CodePipeline free?

For light use, often yes: the first 100 V2 action minutes each month are free, and one active V1 pipeline is free. Manual approval actions are never billed on V2.

What is the difference between CodePipeline V1 and V2?

V2 is billed per action minute and adds trigger filters on branches, tags and file paths, pipeline variables, queued and parallel execution modes, stage conditions and automatic rollback. V1 is a flat $1 per active pipeline with fewer features.

What is the difference between CodePipeline and CodeBuild?

CodeBuild runs builds and tests. CodePipeline orchestrates the whole release, calling CodeBuild for the build step and other services for source, approval and deployment.

What is the difference between CodePipeline and CodeDeploy?

CodeDeploy performs deployments to EC2, on-premises servers, Lambda and ECS blue/green. CodePipeline decides when to deploy and chains the deployment with source, build, tests and approvals.

Is CodePipeline better than GitHub Actions?

Neither is better for everyone. GitHub Actions is great for workflows next to your code; CodePipeline is AWS-native, uses IAM roles, and handles approvals and cross-account releases well. Many teams use GitHub Actions for tests and CodePipeline for releases.

Can CodePipeline use GitHub?

Yes. Connect GitHub (and GitLab or Bitbucket) through AWS CodeConnections by installing the AWS Connector app, then choose the repository and branch in the source action.

What are CodePipeline artifacts?

The files passed between stages, such as the source code zip, build outputs and imagedefinitions.json, stored in an S3 artifact bucket in your account.

What is a manual approval in CodePipeline?

An action that pauses the pipeline until someone approves or rejects it in the console, optionally with an SNS notification. It times out after 7 days by default (up to 60 days) and is free on V2 pipelines.

How do I trigger CodePipeline only for certain files or branches?

Use a V2 pipeline and add trigger filters: push or pull request events with include and exclude patterns for branches, Git tags and file paths, up to 8 of each per filter.

How do I roll back a CodePipeline deployment?

On V2 pipelines, set a stage's failure behavior to roll back, and CodePipeline redeploys the last successful version when the stage fails. You can also start a rollback manually from the stage, or re-run an older execution.

Can CodePipeline deploy to another AWS account?

Yes. Use cross-account roles in the target account for the deploy actions, and a customer managed KMS key and bucket policy so the target account can read the pipeline's artifacts.

What is the Commands action in CodePipeline?

An action that runs shell commands on managed CodeBuild compute without a separate CodeBuild project, for quick steps such as invalidating a CloudFront cache or running a script. It has a 55-minute timeout and can use Secrets Manager secrets.

How many pipelines can I create?

1,000 per Region per account by default, which can be increased; only 300 of them can use polling for change detection.

How long does CodePipeline keep execution history?

12 months. For longer records, send pipeline events to EventBridge and store them, or keep build logs in CloudWatch Logs with your own retention.

Does CodePipeline work with Terraform?

Yes. Run terraform plan and apply in a CodeBuild or Commands action, with the state in S3, and put a manual approval between plan and apply for production changes.

Is AWS CodePipeline deprecated?

No. CodePipeline is fully supported and gained several new deploy actions in 2025. AWS CodeStar, a project dashboard that used CodePipeline, was discontinued in 2024, and CodeStar Connections were renamed CodeConnections; neither affects CodePipeline itself.

How do I log in to AWS CodePipeline?

There is no separate login. Sign in to the AWS Management Console with your IAM user, IAM Identity Center or root account, and open CodePipeline; your IAM permissions decide which pipelines you can see and change.

Where are CodePipeline logs?

Execution history and action errors are in the CodePipeline console; build output is in CodeBuild's CloudWatch Logs; deployment details are in ECS, CodeDeploy or CloudFormation events; and state changes can be sent to EventBridge for long-term storage.

Does CodePipeline support Perforce or Subversion?

Not as a built-in source. A common workaround is a small job that exports the code from Perforce or Subversion to a zip in S3, which then triggers the pipeline through an S3 source action.

Is a CodePipeline definition YAML or JSON?

The pipeline structure is stored as JSON, which get-pipeline returns and update-pipeline accepts. You can write it in YAML when you define the pipeline in CloudFormation, and in HCL with Terraform.

Can I run a CodePipeline manually?

Yes. Choose Release change in the console, or run aws codepipeline start-pipeline-execution with the pipeline name. On V2 pipelines you can also pass variable values for that run, such as a version number or a target environment.

How do I stop a running CodePipeline execution?

Choose Stop execution in the console, or run aws codepipeline stop-pipeline-execution. You can let in-progress actions finish, or abandon them; an abandoned deployment may need checking in the target service.

Can one pipeline deploy to several Regions?

Yes. Actions can run in a different Region from the pipeline; CodePipeline keeps an artifact bucket in each Region it deploys to, so you can release the same build to, for example, US East and Europe in one execution.

Is CodePipeline a CI/CD tool?

Yes, it is AWS's continuous delivery service. Paired with CodeBuild for builds and tests, it covers the full CI/CD loop: every change is built, tested, optionally approved and deployed automatically.

Do I need CodeCommit to use CodePipeline?

No. CodePipeline works with GitHub, GitLab, Bitbucket, CodeCommit, S3 or ECR as the source, so you can keep your code wherever it already lives.

Can CodePipeline send notifications to Slack or email?

Yes. Create a notification rule on the pipeline for events such as failed, succeeded or approval needed, and send it to an SNS topic for email, or to Amazon Q Developer in chat applications for Slack and Microsoft Teams.

Is AWS CodeBuild free?

Partly. CodeBuild includes 100 free build minutes a month on the general1.small machine type; beyond that, Linux builds on that machine cost $0.005 a minute, with larger machines priced higher per minute.

What is the purpose of AWS CodePipeline?

To make releases automatic, consistent and visible: every change goes through the same build, test, approval and deployment steps, failures stop the release before it reaches users, and you have a history of what was released and when.

Why is my GitHub connection stuck in Pending?

The connection was created but the GitHub side was not completed. Choose Update pending connection in the AWS console and finish installing the AWS Connector app; in a GitHub organization, an owner may need to approve the installation.

Why did my CodePipeline execution say Superseded?

In SUPERSEDED mode, a newer execution replaced an older one that was waiting at a stage, so only the latest change continues. Switch to QUEUED mode if every commit must be released in order.

For readers preparing for an AWS certification

We have been covering AWS certifications alongside our fixes, so here is a short extra for readers studying for one. If you only came for the fix, you already have it; feel free to skip this part.

Exams that test this topic: Developer – Associate (DVA-C03 from December 1, 2026) • DevOps Engineer – Professional (DOP-C02) • Solutions Architect – Associate (SAA-C03).

Here are the exam-style questions this topic tends to raise, with the reasoning you need to answer them:

1. A team wants every push to main to be built, tested and deployed to ECS automatically, with a manual approval before production. Which service orchestrates this?

AWS CodePipeline (with CodeBuild for the build and an ECS deploy action).

2. A pipeline must start only when files under the src folder of a monorepo change. Which pipeline type supports this?

A V2 pipeline with trigger file path filters.

3. Every commit must be released in order, even if commits arrive quickly. Which execution mode fits?

QUEUED mode.

4. How does CodePipeline connect to a GitHub repository securely?

Through an AWS CodeConnections (formerly CodeStar Connections) connection using the AWS Connector GitHub app.

5. A pipeline in a tools account must deploy to a production account. What is required for the artifacts?

A customer managed KMS key and bucket policy that let the production account roles read the artifact bucket, plus cross-account deploy roles.

6. The ECS deploy action fails reading its input. Which file must the build stage produce?

imagedefinitions.json, with the container name matching the task definition.

7. A failed production deployment should return to the last good version automatically. Which V2 feature does this?

Stage rollback on failure (stage conditions with automatic rollback).

Exam codes and dates change often. Our AWS certification changes page keeps track of what is current.

πŸ“š ALSO READ

Where to go next, from CodeBuild errors to EventBridge:

📌 Bookmark this; the pricing examples, the action table and the error fixes are the parts you will come back for.

The store's next release went out on a Tuesday morning, from a merged pull request, while the developer was in a meeting. The pipeline built the image, waited for the owner's approval email, deployed, and rolled back once in the following month when a bad configuration failed its health checks, before any customer noticed. The checklist came off the monitor. Jake asked for it as a souvenir and stuck it on his own workshop wall, under a note that said "automate this."

📌 If you keep one line from this page

AWS CodePipeline automates your release from source to production; V2 pipelines cost $0.002 per action minute after 100 free minutes a month (V1 is $1 per active pipeline), so a typical small pipeline costs cents a month plus CodeBuild minutes, with approvals free and rollback built in.

Use V2 triggers with filters · match container names in imagedefinitions.json · roll back on failure.

Revision note. Written October 21, 2026. Prices are US list prices on that date. We will update this page when CodePipeline prices, actions or quotas change.

Related