@Generated(value="jsii-pacmak/1.67.0 (build 2c027f5)", date="2022-09-19T20:26:37.525Z") @Stability(value=Stable) public class CodeCommitSourceAction extends Action
If the CodeCommit repository is in a different account, you must use
CodeCommitTrigger.EVENTS to trigger the pipeline.
(That is because the Pipeline structure normally only has a RepositoryName
field, and that is not enough for the pipeline to locate the repository's
source account. However, if the pipeline is triggered via an EventBridge
event, the event itself has the full repository ARN in there, allowing the
pipeline to locate the repository).
Example:
// Source stage: read from repository
Repository repo = Repository.Builder.create(stack, "TemplateRepo")
.repositoryName("template-repo")
.build();
Artifact sourceOutput = new Artifact("SourceArtifact");
CodeCommitSourceAction source = CodeCommitSourceAction.Builder.create()
.actionName("Source")
.repository(repo)
.output(sourceOutput)
.trigger(CodeCommitTrigger.POLL)
.build();
Map<String, Object> sourceStage = Map.of(
"stageName", "Source",
"actions", List.of(source));
// Deployment stage: create and deploy changeset with manual approval
String stackName = "OurStack";
String changeSetName = "StagedChangeSet";
Map<String, Object> prodStage = Map.of(
"stageName", "Deploy",
"actions", List.of(
CloudFormationCreateReplaceChangeSetAction.Builder.create()
.actionName("PrepareChanges")
.stackName(stackName)
.changeSetName(changeSetName)
.adminPermissions(true)
.templatePath(sourceOutput.atPath("template.yaml"))
.runOrder(1)
.build(),
ManualApprovalAction.Builder.create()
.actionName("ApproveChanges")
.runOrder(2)
.build(),
CloudFormationExecuteChangeSetAction.Builder.create()
.actionName("ExecuteChanges")
.stackName(stackName)
.changeSetName(changeSetName)
.runOrder(3)
.build()));
Pipeline.Builder.create(stack, "Pipeline")
.stages(List.of(sourceStage, prodStage))
.build();
| Modifier and Type | Class and Description |
|---|---|
static class |
CodeCommitSourceAction.Builder
A fluent builder for
CodeCommitSourceAction. |
software.amazon.jsii.JsiiObject.InitializationModeIAction.Jsii$Default| Modifier | Constructor and Description |
|---|---|
|
CodeCommitSourceAction(CodeCommitSourceActionProps props) |
protected |
CodeCommitSourceAction(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) |
protected |
CodeCommitSourceAction(software.amazon.jsii.JsiiObjectRef objRef) |
| Modifier and Type | Method and Description |
|---|---|
protected ActionConfig |
bound(software.constructs.Construct _scope,
IStage stage,
ActionBindOptions options)
This is a renamed version of the
IAction.bind method. |
CodeCommitSourceVariables |
getVariables()
The variables emitted by this action.
|
getProvidedActionPropertiesbind, getActionProperties, onStateChange, onStateChange, onStateChange, variableExpressionjsiiAsyncCall, jsiiAsyncCall, jsiiCall, jsiiCall, jsiiGet, jsiiGet, jsiiSet, jsiiStaticCall, jsiiStaticCall, jsiiStaticGet, jsiiStaticGet, jsiiStaticSet, jsiiStaticSetprotected CodeCommitSourceAction(software.amazon.jsii.JsiiObjectRef objRef)
protected CodeCommitSourceAction(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
@Stability(value=Stable)
public CodeCommitSourceAction(@NotNull
CodeCommitSourceActionProps props)
props - This parameter is required.@Stability(value=Stable) @NotNull protected ActionConfig bound(@NotNull software.constructs.Construct _scope, @NotNull IStage stage, @NotNull ActionBindOptions options)
IAction.bind method.
@Stability(value=Stable) @NotNull public CodeCommitSourceVariables getVariables()
Copyright © 2022. All rights reserved.