aws-cdk-lib.aws_codepipeline_actions.CodeCommitTrigger

enum CodeCommitTrigger

LanguageType name
.NETAmazon.CDK.AWS.CodePipeline.Actions.CodeCommitTrigger
Gogithub.com/aws/aws-cdk-go/awscdk/v2/awscodepipelineactions#CodeCommitTrigger
Javasoftware.amazon.awscdk.services.codepipeline.actions.CodeCommitTrigger
Pythonaws_cdk.aws_codepipeline_actions.CodeCommitTrigger
TypeScript (source)aws-cdk-lib » aws_codepipeline_actions » CodeCommitTrigger

How should the CodeCommit Action detect changes.

This is the type of the CodeCommitSourceAction.trigger property.

Example

// Source stage: read from repository
const repo = new codecommit.Repository(stack, 'TemplateRepo', {
  repositoryName: 'template-repo',
});
const sourceOutput = new codepipeline.Artifact('SourceArtifact');
const source = new cpactions.CodeCommitSourceAction({
  actionName: 'Source',
  repository: repo,
  output: sourceOutput,
  trigger: cpactions.CodeCommitTrigger.POLL,
});
const sourceStage = {
  stageName: 'Source',
  actions: [source],
};

// Deployment stage: create and deploy changeset with manual approval
const stackName = 'OurStack';
const changeSetName = 'StagedChangeSet';

const prodStage = {
  stageName: 'Deploy',
  actions: [
    new cpactions.CloudFormationCreateReplaceChangeSetAction({
      actionName: 'PrepareChanges',
      stackName,
      changeSetName,
      adminPermissions: true,
      templatePath: sourceOutput.atPath('template.yaml'),
      runOrder: 1,
    }),
    new cpactions.ManualApprovalAction({
      actionName: 'ApproveChanges',
      runOrder: 2,
    }),
    new cpactions.CloudFormationExecuteChangeSetAction({
      actionName: 'ExecuteChanges',
      stackName,
      changeSetName,
      runOrder: 3,
    }),
  ],
};

new codepipeline.Pipeline(stack, 'Pipeline', {
  stages: [
    sourceStage,
    prodStage,
  ],
});

Members

NameDescription
NONEThe Action will never detect changes - the Pipeline it's part of will only begin a run when explicitly started.
POLLCodePipeline will poll the repository to detect changes.
EVENTSCodePipeline will use CloudWatch Events to be notified of changes.

NONE

The Action will never detect changes - the Pipeline it's part of will only begin a run when explicitly started.


POLL

CodePipeline will poll the repository to detect changes.


EVENTS

CodePipeline will use CloudWatch Events to be notified of changes.

This is the default method of detecting changes.