Class StackSetDeploymentModel
- All Implemented Interfaces:
software.amazon.jsii.JsiiSerializable
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());
-
Nested Class Summary
Nested classes/interfaces inherited from class software.amazon.jsii.JsiiObject
software.amazon.jsii.JsiiObject.InitializationMode
-
Constructor Summary
ModifierConstructorDescriptionprotected
protected
StackSetDeploymentModel
(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) protected
StackSetDeploymentModel
(software.amazon.jsii.JsiiObjectRef objRef) -
Method Summary
Modifier and TypeMethodDescriptionstatic StackSetDeploymentModel
Deploy to AWS Organizations accounts.static StackSetDeploymentModel
Deploy to AWS Organizations accounts.static StackSetDeploymentModel
Deploy to AWS Accounts not managed by AWS Organizations.static StackSetDeploymentModel
Deploy to AWS Accounts not managed by AWS Organizations.Methods inherited from class software.amazon.jsii.JsiiObject
jsiiAsyncCall, jsiiAsyncCall, jsiiCall, jsiiCall, jsiiGet, jsiiGet, jsiiSet, jsiiStaticCall, jsiiStaticCall, jsiiStaticGet, jsiiStaticGet, jsiiStaticSet, jsiiStaticSet
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface software.amazon.jsii.JsiiSerializable
$jsii$toJson
-
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
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()
orRole.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
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()
orRole.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.
-