Class StackSetDeploymentModel

java.lang.Object
software.amazon.jsii.JsiiObject
software.amazon.awscdk.services.codepipeline.actions.StackSetDeploymentModel
All Implemented Interfaces:
software.amazon.jsii.JsiiSerializable

@Generated(value="jsii-pacmak/1.84.0 (build 5404dcf)", date="2023-06-19T16:30:48.500Z") @Stability(Stable) public abstract class StackSetDeploymentModel extends software.amazon.jsii.JsiiObject
Determines how IAM roles are created and managed.

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

    • StackSetDeploymentModel

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

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

      @Stability(Stable) protected StackSetDeploymentModel()
  • Method Details

    • organizations

      @Stability(Stable) @NotNull public static StackSetDeploymentModel organizations(@Nullable OrganizationsDeploymentProps props)
      Deploy to AWS Organizations accounts.

      AWS CloudFormation StackSets automatically creates the IAM roles required to deploy to accounts managed by AWS Organizations. This requires an account to be a member of an Organization.

      Using this deployment model, you can specify either AWS Account Ids or Organization Unit Ids in the stackInstances parameter.

      Parameters:
      props -
    • organizations

      @Stability(Stable) @NotNull public static StackSetDeploymentModel organizations()
      Deploy to AWS Organizations accounts.

      AWS CloudFormation StackSets automatically creates the IAM roles required to deploy to accounts managed by AWS Organizations. This requires an account to be a member of an Organization.

      Using this deployment model, you can specify either AWS Account Ids or Organization Unit Ids in the stackInstances parameter.

    • selfManaged

      @Stability(Stable) @NotNull public static StackSetDeploymentModel selfManaged(@Nullable SelfManagedDeploymentProps props)
      Deploy to AWS Accounts not managed by AWS Organizations.

      You are responsible for creating Execution Roles in every account you will be deploying to in advance to create the actual stack instances. Unless you specify overrides, StackSets expects the execution roles you create to have the default name AWSCloudFormationStackSetExecutionRole. See the Grant self-managed permissions section of the CloudFormation documentation.

      The CDK will automatically create the central Administration Role in the Pipeline account which will be used to assume the Execution Role in each of the target accounts.

      If you wish to use a pre-created Administration Role, use Role.fromRoleName() or Role.fromRoleArn() to import it, and pass it to this function:

       IRole existingAdminRole = Role.fromRoleName(this, "AdminRole", "AWSCloudFormationStackSetAdministrationRole");
       StackSetDeploymentModel deploymentModel = StackSetDeploymentModel.selfManaged(SelfManagedDeploymentProps.builder()
               // Use an existing Role. Leave this out to create a new Role.
               .administrationRole(existingAdminRole)
               .build());
       

      Using this deployment model, you can only specify AWS Account Ids in the stackInstances parameter.

      Parameters:
      props -
      See Also:
    • selfManaged

      @Stability(Stable) @NotNull public static StackSetDeploymentModel selfManaged()
      Deploy to AWS Accounts not managed by AWS Organizations.

      You are responsible for creating Execution Roles in every account you will be deploying to in advance to create the actual stack instances. Unless you specify overrides, StackSets expects the execution roles you create to have the default name AWSCloudFormationStackSetExecutionRole. See the Grant self-managed permissions section of the CloudFormation documentation.

      The CDK will automatically create the central Administration Role in the Pipeline account which will be used to assume the Execution Role in each of the target accounts.

      If you wish to use a pre-created Administration Role, use Role.fromRoleName() or Role.fromRoleArn() to import it, and pass it to this function:

       IRole existingAdminRole = Role.fromRoleName(this, "AdminRole", "AWSCloudFormationStackSetAdministrationRole");
       StackSetDeploymentModel deploymentModel = StackSetDeploymentModel.selfManaged(SelfManagedDeploymentProps.builder()
               // Use an existing Role. Leave this out to create a new Role.
               .administrationRole(existingAdminRole)
               .build());
       

      Using this deployment model, you can only specify AWS Account Ids in the stackInstances parameter.

      See Also: