AWS CodePipeline
User Guide (API Version 2015-07-09)

The procedures in this guide support the new console design. If you choose to use the older version of the console, you will find many of the concepts and basic procedures in this guide still apply. To access help in the new console, choose the information icon.

Start a Pipeline Execution in AWS CodePipeline

When a pipeline execution starts, it runs a revision through every stage and action in the pipeline.

There are two ways to start a pipeline execution:

  • Automatically: Using change detection methods that you specify, you can make your pipeline start when a change is made to a repository. You can also make your pipeline start on a schedule. The following are the automatic change detection methods:

    • When you use the console to create a pipeline that has an AWS CodeCommit source repository or Amazon S3 source bucket, AWS CodePipeline creates an Amazon CloudWatch Events rule that starts your pipeline when the source changes. This is the recommended change detection method. If you use the AWS CLI to create the pipeline, the change detection method defaults to starting the pipeline by periodically checking the source. We recommend that you disable periodic checks and create the additional resources manually. For more information, see Use CloudWatch Events to Start an AWS CodeCommit Pipeline.

    • When you use the console to create a pipeline that has a GitHub repository, AWS CodePipeline creates a webhook that starts your pipeline when the source changes. This is the recommended change detection method. If you use the AWS CLI to create the pipeline, the change detection method defaults to starting the pipeline by periodically checking the source. We recommend that you disable periodic checks and create the additional resources manually. For more information, see Use Webhooks to Start a GitHub Pipeline.

  • Manually: You can use the console or the AWS CLI to start a pipeline manually. For information, see Start a Pipeline Manually in AWS CodePipeline.

By default, pipelines are configured to start automatically using change detection methods.

Note

Your pipeline runs only when something changes in the source repository and branch that you have defined.

Change Detection Methods Used to Start Pipelines Automatically

When you create or update a pipeline, you specify the method to use to react to source repository changes. Your choice determines how your pipeline is started.

You can use the console, CLI, or AWS CloudFormation to specify your change detection method.

Source Detection Method Description Requires Additional Resources? How to Migrate Pipelines to the Recommended Change Detection Method
Amazon S3 Amazon CloudWatch Events (recommended). This is the default for S3 pipelines created or edited in the console.
  • Your pipeline is triggered as soon as a change is made to the repository. Events in your bucket are filtered by AWS CloudTrail, and then the Amazon CloudWatch Events rule triggers your pipeline to start.

  • Faster and more configurable than periodic checks.

Yes. Amazon CloudWatch Events rule and an AWS CloudTrail trail must be applied. To create a pipeline that uses source triggers (not periodic checks), see Configure Your Amazon S3 Pipelines to Use Amazon CloudWatch Events for Change Detection. To update a pipeline to use source triggers, see Edit Pipelines to Use Push Events.
Periodic checks AWS CodePipeline periodically contacts the source. No
AWS CodeCommit Amazon CloudWatch Events (recommended). This is the default for AWS CodeCommit pipelines created or edited in the console.
  • Your pipeline is triggered as soon as a change is made to the repository.

  • Faster and more configurable than periodic checks.

Yes. Amazon CloudWatch Events rule must be applied. To create a pipeline that uses source triggers (not periodic checks), see Configure Your AWS CodeCommit Pipelines to Use Amazon CloudWatch Events for Change Detection. To update a pipeline to use source triggers, see Edit Pipelines to Use Push Events.
Periodic checks AWS CodePipeline periodically contacts the source repository. No
GitHub Webhooks (recommended). This is the default for GitHub pipelines created or edited in the console.
  • Your pipeline is triggered as soon as a change is made to the repository.

  • Faster and more configurable than periodic checks.

Yes To create a pipeline that uses source triggers (not periodic checks), see Configure Your GitHub Pipelines to Use Webhooks for Change Detection. To update a pipeline to use source triggers, see Edit Pipelines to Use Push Events.
Periodic checks AWS CodePipeline periodically contacts the source repository. No