aws-cdk-lib.aws_codepipeline_actions.CodeCommitSourceActionProps

interface CodeCommitSourceActionProps

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

Construction properties of the CodeCommitSourceAction CodeCommit source CodePipeline Action.

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,
  ],
});

Properties

NameTypeDescription
actionNamestringThe physical, human-readable name of the Action.
outputArtifact
repositoryIRepositoryThe CodeCommit repository.
branch?string
codeBuildCloneOutput?booleanWhether the output should be the contents of the repository (which is the default), or a link that allows CodeBuild to clone the repository before building.
eventRole?IRoleRole to be used by on commit event rule.
role?IRoleThe Role in which context's this Action will be executing in.
runOrder?numberThe runOrder property for this Action.
trigger?CodeCommitTriggerHow should CodePipeline detect source changes for this Action.
variablesNamespace?stringThe name of the namespace to use for variables emitted by this action.

actionName

Type: string

The physical, human-readable name of the Action.

Note that Action names must be unique within a single Stage.


output

Type: Artifact


repository

Type: IRepository

The CodeCommit repository.


branch?

Type: string (optional, default: 'master')


codeBuildCloneOutput?

Type: boolean (optional, default: false)

Whether the output should be the contents of the repository (which is the default), or a link that allows CodeBuild to clone the repository before building.

Note: if this option is true, then only CodeBuild actions can use the resulting output.

See also: https://docs.aws.amazon.com/codepipeline/latest/userguide/action-reference-CodeCommit.html


eventRole?

Type: IRole (optional, default: a new role will be created.)

Role to be used by on commit event rule.

Used only when trigger value is CodeCommitTrigger.EVENTS.


role?

Type: IRole (optional, default: a new Role will be generated)

The Role in which context's this Action will be executing in.

The Pipeline's Role will assume this Role (the required permissions for that will be granted automatically) right before executing this Action. This Action will be passed into your IAction.bind method in the ActionBindOptions.role property.


runOrder?

Type: number (optional, default: 1)

The runOrder property for this Action.

RunOrder determines the relative order in which multiple Actions in the same Stage execute.

See also: https://docs.aws.amazon.com/codepipeline/latest/userguide/reference-pipeline-structure.html


trigger?

Type: CodeCommitTrigger (optional, default: CodeCommitTrigger.EVENTS)

How should CodePipeline detect source changes for this Action.


variablesNamespace?

Type: string (optional, default: a name will be generated, based on the stage and action names, if any of the action's variables were referenced - otherwise, no namespace will be set)

The name of the namespace to use for variables emitted by this action.