Class CloudFormationDeployStackSetAction
CodePipeline action to deploy a stackset.
Implements
Inherited Members
Namespace: Amazon.CDK.AWS.CodePipeline.Actions
Assembly: Amazon.CDK.Lib.dll
Syntax (csharp)
public class CloudFormationDeployStackSetAction : Action, IAction
Syntax (vb)
Public Class CloudFormationDeployStackSetAction
Inherits Action
Implements IAction
Remarks
CodePipeline offers the ability to perform AWS CloudFormation StackSets operations as part of your CI/CD process. You use a stack set to create stacks in AWS accounts across AWS Regions by using a single AWS CloudFormation template. All the resources included in each stack are defined by the stack set’s AWS CloudFormation template. When you create the stack set, you specify the template to use, as well as any parameters and capabilities that the template requires.
For more information about concepts for AWS CloudFormation StackSets, see StackSets concepts in the AWS CloudFormation User Guide.
If you use this action to make an update that includes adding stack instances, the new instances are deployed first and the update is completed last. The new instances first receive the old version, and then the update is applied to all instances.
As a best practice, you should construct your pipeline so that the stack set is created and initially deploys to a subset or a single instance. After you test your deployment and view the generated stack set, then add the CloudFormationStackInstances action so that the remaining instances are created and updated.
ExampleMetadata: infused
Examples
Pipeline pipeline;
Artifact sourceOutput;
pipeline.AddStage(new StageOptions {
StageName = "DeployStackSets",
Actions = new [] {
// First, update the StackSet itself with the newest template
new CloudFormationDeployStackSetAction(new CloudFormationDeployStackSetActionProps {
ActionName = "UpdateStackSet",
RunOrder = 1,
StackSetName = "MyStackSet",
Template = StackSetTemplate.FromArtifactPath(sourceOutput.AtPath("template.yaml")),
// Change this to 'StackSetDeploymentModel.organizations()' if you want to deploy to OUs
DeploymentModel = StackSetDeploymentModel.SelfManaged(),
// This deploys to a set of accounts
StackInstances = StackInstances.InAccounts(new [] { "111111111111" }, new [] { "us-east-1", "eu-west-1" })
}),
// Afterwards, update/create additional instances in other accounts
new CloudFormationDeployStackInstancesAction(new CloudFormationDeployStackInstancesActionProps {
ActionName = "AddMoreInstances",
RunOrder = 2,
StackSetName = "MyStackSet",
StackInstances = StackInstances.InAccounts(new [] { "222222222222", "333333333333" }, new [] { "us-east-1", "eu-west-1" })
}) }
});
Synopsis
Constructors
CloudFormationDeployStackSetAction(ICloudFormationDeployStackSetActionProps) | |
CloudFormationDeployStackSetAction(ByRefValue) | Used by jsii to construct an instance of this class from a Javascript-owned object reference |
CloudFormationDeployStackSetAction(DeputyBase.DeputyProps) | Used by jsii to construct an instance of this class from DeputyProps |
Methods
Bound(Construct, IStage, IActionBindOptions) | This is a renamed version of the |
Constructors
CloudFormationDeployStackSetAction(ICloudFormationDeployStackSetActionProps)
public CloudFormationDeployStackSetAction(ICloudFormationDeployStackSetActionProps props)
Parameters
CloudFormationDeployStackSetAction(ByRefValue)
Used by jsii to construct an instance of this class from a Javascript-owned object reference
protected CloudFormationDeployStackSetAction(ByRefValue reference)
Parameters
- reference Amazon.JSII.Runtime.Deputy.ByRefValue
The Javascript-owned object reference
CloudFormationDeployStackSetAction(DeputyBase.DeputyProps)
Used by jsii to construct an instance of this class from DeputyProps
protected CloudFormationDeployStackSetAction(DeputyBase.DeputyProps props)
Parameters
- props Amazon.JSII.Runtime.Deputy.DeputyBase.DeputyProps
The deputy props
Methods
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