Class CloudFormationDeployStackSetAction

java.lang.Object
software.amazon.jsii.JsiiObject
software.amazon.awscdk.services.codepipeline.Action
software.amazon.awscdk.services.codepipeline.actions.Action
software.amazon.awscdk.services.codepipeline.actions.CloudFormationDeployStackSetAction
All Implemented Interfaces:
IAction, software.amazon.jsii.JsiiSerializable

@Generated(value="jsii-pacmak/1.98.0 (build 00b106d)", date="2024-05-08T21:35:04.489Z") @Stability(Stable) public class CloudFormationDeployStackSetAction extends Action
CodePipeline action to deploy a stackset.

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.

Example:

 Pipeline pipeline;
 Artifact sourceOutput;
 pipeline.addStage(StageOptions.builder()
         .stageName("DeployStackSets")
         .actions(List.of(
             // First, update the StackSet itself with the newest template
             CloudFormationDeployStackSetAction.Builder.create()
                     .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(List.of("111111111111"), List.of("us-east-1", "eu-west-1")))
                     .build(),
             // Afterwards, update/create additional instances in other accounts
             CloudFormationDeployStackInstancesAction.Builder.create()
                     .actionName("AddMoreInstances")
                     .runOrder(2)
                     .stackSetName("MyStackSet")
                     .stackInstances(StackInstances.inAccounts(List.of("222222222222", "333333333333"), List.of("us-east-1", "eu-west-1")))
                     .build()))
         .build());
 
  • Constructor Details

    • CloudFormationDeployStackSetAction

      protected CloudFormationDeployStackSetAction(software.amazon.jsii.JsiiObjectRef objRef)
    • CloudFormationDeployStackSetAction

      protected CloudFormationDeployStackSetAction(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
    • CloudFormationDeployStackSetAction

      @Stability(Stable) public CloudFormationDeployStackSetAction(@NotNull CloudFormationDeployStackSetActionProps props)
      Parameters:
      props - This parameter is required.
  • Method Details

    • bound

      @Stability(Stable) @NotNull protected ActionConfig bound(@NotNull software.constructs.Construct scope, @NotNull IStage _stage, @NotNull ActionBindOptions options)
      This is a renamed version of the IAction.bind method.

      Specified by:
      bound in class Action
      Parameters:
      scope - This parameter is required.
      _stage - This parameter is required.
      options - This parameter is required.