@Generated(value="jsii-pacmak/1.60.0 (build ebcefe6)", date="2022-06-22T23:28:02.354Z") public class CloudFormationCreateUpdateStackAction extends Action
Creates the stack if the specified stack doesn't exist. If the stack exists, AWS CloudFormation updates the stack. Use this action to update existing stacks.
AWS CodePipeline won't replace the stack, and will fail deployment if the
stack is in a failed state. Use ReplaceOnFailure
for an action that
will delete and recreate the stack to try and recover from failed states.
Use this action to automatically replace failed stacks without recovering or troubleshooting them. You would typically choose this mode for testing.
Example:
import software.amazon.awscdk.core.PhysicalName; // in stack for account 123456789012... Stack otherAccountStack; Role actionRole = Role.Builder.create(otherAccountStack, "ActionRole") .assumedBy(new AccountPrincipal("123456789012")) // the role has to have a physical name set .roleName(PhysicalName.GENERATE_IF_NEEDED) .build(); // in the pipeline stack... Artifact sourceOutput = new Artifact(); CloudFormationCreateUpdateStackAction.Builder.create() .actionName("CloudFormationCreateUpdate") .stackName("MyStackName") .adminPermissions(true) .templatePath(sourceOutput.atPath("template.yaml")) .role(actionRole) .build();
Modifier and Type | Class and Description |
---|---|
static class |
CloudFormationCreateUpdateStackAction.Builder
A fluent builder for
CloudFormationCreateUpdateStackAction . |
IAction.Jsii$Default
Modifier | Constructor and Description |
---|---|
protected |
CloudFormationCreateUpdateStackAction(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) |
protected |
CloudFormationCreateUpdateStackAction(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 CloudFormationCreateUpdateStackAction(software.amazon.jsii.JsiiObjectRef objRef)
protected CloudFormationCreateUpdateStackAction(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()