@Generated(value="jsii-pacmak/1.60.0 (build ebcefe6)", date="2022-07-01T09:58:42.983Z") public class CloudFormationCreateReplaceChangeSetAction extends Action
Creates the change set if it doesn't exist based on the stack name and template that you submit. If the change set exists, AWS CloudFormation deletes it, and then creates a new one.
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 |
CloudFormationCreateReplaceChangeSetAction.Builder
A fluent builder for
CloudFormationCreateReplaceChangeSetAction . |
IAction.Jsii$Default
Modifier | Constructor and Description |
---|---|
protected |
CloudFormationCreateReplaceChangeSetAction(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) |
protected |
CloudFormationCreateReplaceChangeSetAction(software.amazon.jsii.JsiiObjectRef objRef) |
Modifier and Type | Method and Description |
---|---|
java.lang.Boolean |
addToDeploymentRolePolicy(PolicyStatement statement)
Add statement to the service role assumed by CloudFormation while executing this action.
|
protected ActionConfig |
bound(Construct scope,
IStage stage,
ActionBindOptions options)
This is a renamed version of the
IAction.bind method. |
IRole |
getDeploymentRole() |
getProvidedActionProperties
bind, getActionProperties, onStateChange, onStateChange, onStateChange, variableExpression
protected CloudFormationCreateReplaceChangeSetAction(software.amazon.jsii.JsiiObjectRef objRef)
protected CloudFormationCreateReplaceChangeSetAction(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
public java.lang.Boolean addToDeploymentRolePolicy(PolicyStatement statement)
statement
- This parameter is required.protected ActionConfig bound(Construct scope, IStage stage, ActionBindOptions options)
IAction.bind
method.
public IRole getDeploymentRole()