Show / Hide Table of Contents

Class CloudFormationCreateReplaceChangeSetAction

CodePipeline action to prepare a change set.

Inheritance
object
Action
Action
CloudFormationCreateReplaceChangeSetAction
Implements
IAction
Inherited Members
Action.ProvidedActionProperties
Action.Bind(Construct, IStage, IActionBindOptions)
Action.OnStateChange(string, IRuleTarget, IRuleProps)
Action.VariableExpression(string)
Action.ActionProperties
Namespace: Amazon.CDK.AWS.CodePipeline.Actions
Assembly: Amazon.CDK.Lib.dll
Syntax (csharp)
public class CloudFormationCreateReplaceChangeSetAction : Action, IAction
Syntax (vb)
Public Class CloudFormationCreateReplaceChangeSetAction Inherits Action Implements IAction
Remarks

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.

ExampleMetadata: lit=aws-codepipeline-actions/test/integ.cfn-template-from-repo.lit.ts infused

Examples
// Source stage: read from repository
             var repo = new Repository(stack, "TemplateRepo", new RepositoryProps {
                 RepositoryName = "template-repo"
             });
             var sourceOutput = new Artifact("SourceArtifact");
             var source = new CodeCommitSourceAction(new CodeCommitSourceActionProps {
                 ActionName = "Source",
                 Repository = repo,
                 Output = sourceOutput,
                 Trigger = CodeCommitTrigger.POLL
             });
             IDictionary<string, object> sourceStage = new Dictionary<string, object> {
                 { "stageName", "Source" },
                 { "actions", new [] { source } }
             };

             // Deployment stage: create and deploy changeset with manual approval
             var stackName = "OurStack";
             var changeSetName = "StagedChangeSet";

             IDictionary<string, object> prodStage = new Dictionary<string, object> {
                 { "stageName", "Deploy" },
                 { "actions", new [] {
                     new CloudFormationCreateReplaceChangeSetAction(new CloudFormationCreateReplaceChangeSetActionProps {
                         ActionName = "PrepareChanges",
                         StackName = stackName,
                         ChangeSetName = changeSetName,
                         AdminPermissions = true,
                         TemplatePath = sourceOutput.AtPath("template.yaml"),
                         RunOrder = 1
                     }),
                     new ManualApprovalAction(new ManualApprovalActionProps {
                         ActionName = "ApproveChanges",
                         RunOrder = 2
                     }),
                     new CloudFormationExecuteChangeSetAction(new CloudFormationExecuteChangeSetActionProps {
                         ActionName = "ExecuteChanges",
                         StackName = stackName,
                         ChangeSetName = changeSetName,
                         RunOrder = 3
                     }) } }
             };

             new Pipeline(stack, "Pipeline", new PipelineProps {
                 CrossAccountKeys = true,
                 Stages = new [] { sourceStage, prodStage }
             });

Synopsis

Constructors

CloudFormationCreateReplaceChangeSetAction(ICloudFormationCreateReplaceChangeSetActionProps)

CodePipeline action to prepare a change set.

Properties

DeploymentRole

CodePipeline action to prepare a change set.

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 IAction.bind method.

Constructors

CloudFormationCreateReplaceChangeSetAction(ICloudFormationCreateReplaceChangeSetActionProps)

CodePipeline action to prepare a change set.

public CloudFormationCreateReplaceChangeSetAction(ICloudFormationCreateReplaceChangeSetActionProps props)
Parameters
props ICloudFormationCreateReplaceChangeSetActionProps
Remarks

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.

ExampleMetadata: lit=aws-codepipeline-actions/test/integ.cfn-template-from-repo.lit.ts infused

Examples
// Source stage: read from repository
             var repo = new Repository(stack, "TemplateRepo", new RepositoryProps {
                 RepositoryName = "template-repo"
             });
             var sourceOutput = new Artifact("SourceArtifact");
             var source = new CodeCommitSourceAction(new CodeCommitSourceActionProps {
                 ActionName = "Source",
                 Repository = repo,
                 Output = sourceOutput,
                 Trigger = CodeCommitTrigger.POLL
             });
             IDictionary<string, object> sourceStage = new Dictionary<string, object> {
                 { "stageName", "Source" },
                 { "actions", new [] { source } }
             };

             // Deployment stage: create and deploy changeset with manual approval
             var stackName = "OurStack";
             var changeSetName = "StagedChangeSet";

             IDictionary<string, object> prodStage = new Dictionary<string, object> {
                 { "stageName", "Deploy" },
                 { "actions", new [] {
                     new CloudFormationCreateReplaceChangeSetAction(new CloudFormationCreateReplaceChangeSetActionProps {
                         ActionName = "PrepareChanges",
                         StackName = stackName,
                         ChangeSetName = changeSetName,
                         AdminPermissions = true,
                         TemplatePath = sourceOutput.AtPath("template.yaml"),
                         RunOrder = 1
                     }),
                     new ManualApprovalAction(new ManualApprovalActionProps {
                         ActionName = "ApproveChanges",
                         RunOrder = 2
                     }),
                     new CloudFormationExecuteChangeSetAction(new CloudFormationExecuteChangeSetActionProps {
                         ActionName = "ExecuteChanges",
                         StackName = stackName,
                         ChangeSetName = changeSetName,
                         RunOrder = 3
                     }) } }
             };

             new Pipeline(stack, "Pipeline", new PipelineProps {
                 CrossAccountKeys = true,
                 Stages = new [] { sourceStage, prodStage }
             });

Properties

DeploymentRole

CodePipeline action to prepare a change set.

public virtual IRole DeploymentRole { get; }
Property Value

IRole

Remarks

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.

ExampleMetadata: lit=aws-codepipeline-actions/test/integ.cfn-template-from-repo.lit.ts infused

Examples
// Source stage: read from repository
             var repo = new Repository(stack, "TemplateRepo", new RepositoryProps {
                 RepositoryName = "template-repo"
             });
             var sourceOutput = new Artifact("SourceArtifact");
             var source = new CodeCommitSourceAction(new CodeCommitSourceActionProps {
                 ActionName = "Source",
                 Repository = repo,
                 Output = sourceOutput,
                 Trigger = CodeCommitTrigger.POLL
             });
             IDictionary<string, object> sourceStage = new Dictionary<string, object> {
                 { "stageName", "Source" },
                 { "actions", new [] { source } }
             };

             // Deployment stage: create and deploy changeset with manual approval
             var stackName = "OurStack";
             var changeSetName = "StagedChangeSet";

             IDictionary<string, object> prodStage = new Dictionary<string, object> {
                 { "stageName", "Deploy" },
                 { "actions", new [] {
                     new CloudFormationCreateReplaceChangeSetAction(new CloudFormationCreateReplaceChangeSetActionProps {
                         ActionName = "PrepareChanges",
                         StackName = stackName,
                         ChangeSetName = changeSetName,
                         AdminPermissions = true,
                         TemplatePath = sourceOutput.AtPath("template.yaml"),
                         RunOrder = 1
                     }),
                     new ManualApprovalAction(new ManualApprovalActionProps {
                         ActionName = "ApproveChanges",
                         RunOrder = 2
                     }),
                     new CloudFormationExecuteChangeSetAction(new CloudFormationExecuteChangeSetActionProps {
                         ActionName = "ExecuteChanges",
                         StackName = stackName,
                         ChangeSetName = changeSetName,
                         RunOrder = 3
                     }) } }
             };

             new Pipeline(stack, "Pipeline", new PipelineProps {
                 CrossAccountKeys = true,
                 Stages = new [] { sourceStage, prodStage }
             });

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

bool

Remarks

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.

ExampleMetadata: lit=aws-codepipeline-actions/test/integ.cfn-template-from-repo.lit.ts infused

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 Construct
stage IStage
options IActionBindOptions
Returns

IActionConfig

Overrides
Action.Bound(Construct, IStage, IActionBindOptions)
Remarks

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.

ExampleMetadata: lit=aws-codepipeline-actions/test/integ.cfn-template-from-repo.lit.ts infused

Implements

IAction
Back to top Generated by DocFX