Class CloudFormationCreateUpdateStackAction
CodePipeline action to deploy a stack.
Implements
Inherited Members
Namespace: Amazon.CDK.AWS.CodePipeline.Actions
Assembly: Amazon.CDK.Lib.dll
Syntax (csharp)
public class CloudFormationCreateUpdateStackAction : Action, IAction
Syntax (vb)
Public Class CloudFormationCreateUpdateStackAction
Inherits Action
Implements IAction
Remarks
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.
ExampleMetadata: infused
Examples
using Amazon.CDK;
// in stack for account 123456789012...
Stack otherAccountStack;
var actionRole = new Role(otherAccountStack, "ActionRole", new RoleProps {
AssumedBy = new AccountPrincipal("123456789012"),
// the role has to have a physical name set
RoleName = PhysicalName.GENERATE_IF_NEEDED
});
// in the pipeline stack...
var sourceOutput = new Artifact();
new CloudFormationCreateUpdateStackAction(new CloudFormationCreateUpdateStackActionProps {
ActionName = "CloudFormationCreateUpdate",
StackName = "MyStackName",
AdminPermissions = true,
TemplatePath = sourceOutput.AtPath("template.yaml"),
Role = actionRole
});
Synopsis
Constructors
CloudFormationCreateUpdateStackAction(ICloudFormationCreateUpdateStackActionProps) | |
CloudFormationCreateUpdateStackAction(ByRefValue) | Used by jsii to construct an instance of this class from a Javascript-owned object reference |
CloudFormationCreateUpdateStackAction(DeputyBase.DeputyProps) | Used by jsii to construct an instance of this class from DeputyProps |
Properties
DeploymentRole |
Methods
AddToDeploymentRolePolicy(PolicyStatement) | Add statement to the service role assumed by CloudFormation while executing this action. |
Bound(Construct, IStage, IActionBindOptions) | This is a renamed version of the |
Constructors
CloudFormationCreateUpdateStackAction(ICloudFormationCreateUpdateStackActionProps)
public CloudFormationCreateUpdateStackAction(ICloudFormationCreateUpdateStackActionProps props)
Parameters
CloudFormationCreateUpdateStackAction(ByRefValue)
Used by jsii to construct an instance of this class from a Javascript-owned object reference
protected CloudFormationCreateUpdateStackAction(ByRefValue reference)
Parameters
- reference Amazon.JSII.Runtime.Deputy.ByRefValue
The Javascript-owned object reference
CloudFormationCreateUpdateStackAction(DeputyBase.DeputyProps)
Used by jsii to construct an instance of this class from DeputyProps
protected CloudFormationCreateUpdateStackAction(DeputyBase.DeputyProps props)
Parameters
- props Amazon.JSII.Runtime.Deputy.DeputyBase.DeputyProps
The deputy props
Properties
DeploymentRole
Methods
AddToDeploymentRolePolicy(PolicyStatement)
Add statement to the service role assumed by CloudFormation while executing this action.
public virtual bool AddToDeploymentRolePolicy(PolicyStatement statement)
Parameters
- statement PolicyStatement
Returns
System.Boolean
Bound(Construct, IStage, IActionBindOptions)
This is a renamed version of the IAction.bind
method.
protected override IActionConfig Bound(Construct scope, IStage stage, IActionBindOptions options)
Parameters
- scope Constructs.Construct
- stage IStage
- options IActionBindOptions
Returns