CodeCommitSourceActionProps Struct
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', {
crossAccountKeys: true,
stages: [
sourceStage,
prodStage,
],
});
Properties
Note that Action names must be unique within a single Stage.
branchoptionalstringbranchoptionalstrbranchoptionalStringBranchoptionalstringBranchoptional*string= 'master'#codeBuildCloneOutputoptionalbooleancode_build_clone_outputoptionalboolcodeBuildCloneOutputoptionalBooleanCodeBuildCloneOutputoptionalboolCodeBuildCloneOutputoptional*bool= false#Note: if this option is true, then only CodeBuild actions can use the resulting output.
customEventRuleoptionalICustomEventRulecustom_event_ruleoptionalICustomEventRulecustomEventRuleoptionalICustomEventRuleCustomEventRuleoptionalICustomEventRuleCustomEventRuleoptionalICustomEventRule#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#Default: a new role will be created.
Used only when trigger value is CodeCommitTrigger.EVENTS.
repositoryIRepositoryrepositoryIRepositoryrepositoryIRepositoryRepositoryIRepositoryRepositoryIRepositoryrequired#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#RunOrder determines the relative order in which multiple Actions in the same Stage execute.
triggeroptionalCodeCommitTriggertriggeroptionalCodeCommitTriggertriggeroptionalCodeCommitTriggerTriggeroptionalCodeCommitTriggerTriggeroptionalCodeCommitTrigger= CodeCommitTrigger.EVENTS#variablesNamespaceoptionalstringvariables_namespaceoptionalstrvariablesNamespaceoptionalStringVariablesNamespaceoptionalstringVariablesNamespaceoptional*string#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