Skip to content
v2.275.0

CodeCommitSourceActionProps Struct ​

Construction properties of the CodeCommitSourceAction CodeCommit source CodePipeline Action.

Example ​

ts
// 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', {
  crossAccountKeys: true,
  stages: [
    sourceStage,
    prodStage,
  ],
});

Properties ​

actionNamestringaction_namestractionNameStringActionNamestringActionName*stringrequired#
The physical, human-readable name of the Action.

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

branchoptionalstringbranchoptionalstrbranchoptionalStringBranchoptionalstringBranchoptional*string= 'master'#
codeBuildCloneOutputoptionalbooleancode_build_clone_outputoptionalboolcodeBuildCloneOutputoptionalBooleanCodeBuildCloneOutputoptionalboolCodeBuildCloneOutputoptional*bool= 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.

customEventRuleoptionalICustomEventRulecustom_event_ruleoptionalICustomEventRulecustomEventRuleoptionalICustomEventRuleCustomEventRuleoptionalICustomEventRuleCustomEventRuleoptionalICustomEventRule#
You can pass a `customEventRule` to set up a custom event rule for the CodeCommit source action.

Default: Event rule which is triggered by CodeCommit repository on commit

You must provide the eventPattern and target properties in the customEventRule object. Check which eventPattern to use: https://docs.aws.amazon.com/codecommit/latest/userguide/monitoring-events.html

eventRoleoptionalIRoleevent_roleoptionalIRoleeventRoleoptionalIRoleEventRoleoptionalIRoleEventRoleoptionalIRole#
Role to be used by on commit event rule.

Default: a new role will be created.

Used only when trigger value is CodeCommitTrigger.EVENTS.

outputArtifactoutputArtifactoutputArtifactOutputArtifactOutputArtifactrequired#
repositoryIRepositoryrepositoryIRepositoryrepositoryIRepositoryRepositoryIRepositoryRepositoryIRepositoryrequired#
The CodeCommit repository.
roleoptionalIRoleroleoptionalIRoleroleoptionalIRoleRoleoptionalIRoleRoleoptionalIRole#
The Role in which context's this Action will be executing in.

Default: a new Role will be generated

notes

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.

runOrderoptionalnumberrun_orderoptionalint | floatrunOrderoptionalNumberRunOrderoptionaldoubleRunOrderoptional*float64= 1#
The runOrder property for this Action.

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

triggeroptionalCodeCommitTriggertriggeroptionalCodeCommitTriggertriggeroptionalCodeCommitTriggerTriggeroptionalCodeCommitTriggerTriggeroptionalCodeCommitTrigger= CodeCommitTrigger.EVENTS#
How should CodePipeline detect source changes for this Action.
variablesNamespaceoptionalstringvariables_namespaceoptionalstrvariablesNamespaceoptionalStringVariablesNamespaceoptionalstringVariablesNamespaceoptional*string#
The name of the namespace to use for variables emitted by this action.

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