Class StackInstances
- 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
StackInstances
(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) protected
StackInstances
(software.amazon.jsii.JsiiObjectRef objRef) -
Method Summary
Modifier and TypeMethodDescriptionstatic StackInstances
fromArtifactPath
(ArtifactPath artifactPath, List<String> regions) Create stack instances in a set of accounts or organizational units taken from the pipeline artifacts, and a set of regions The file must be a JSON file containing a list of strings.static StackInstances
inAccounts
(List<String> accounts, List<String> regions) Create stack instances in a set of accounts and regions passed as literal lists.static StackInstances
inOrganizationalUnits
(List<String> ous, List<String> regions) Create stack instances in all accounts in a set of Organizational Units (OUs) and regions passed as literal lists.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
-
StackInstances
protected StackInstances(software.amazon.jsii.JsiiObjectRef objRef) -
StackInstances
protected StackInstances(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) -
StackInstances
@Stability(Stable) protected StackInstances()
-
-
Method Details
-
fromArtifactPath
@Stability(Stable) @NotNull public static StackInstances fromArtifactPath(@NotNull ArtifactPath artifactPath, @NotNull List<String> regions) Create stack instances in a set of accounts or organizational units taken from the pipeline artifacts, and a set of regions The file must be a JSON file containing a list of strings.For example:
[ "111111111111", "222222222222", "333333333333" ]
Stack Instances will be created in every combination of region and account, or region and Organizational Units (OUs).
If this is set of Organizational Units, you must have selected
StackSetDeploymentModel.organizations()
as deployment model.- Parameters:
artifactPath
- This parameter is required.regions
- This parameter is required.
-
inAccounts
@Stability(Stable) @NotNull public static StackInstances inAccounts(@NotNull List<String> accounts, @NotNull List<String> regions) Create stack instances in a set of accounts and regions passed as literal lists.Stack Instances will be created in every combination of region and account.
NOTE:
StackInstances.inAccounts()
andStackInstances.inOrganizationalUnits()
have exactly the same behavior, and you can use them interchangeably if you want. The only difference between them is that your code clearly indicates what entity it's working with.- Parameters:
accounts
- This parameter is required.regions
- This parameter is required.
-
inOrganizationalUnits
@Stability(Stable) @NotNull public static StackInstances inOrganizationalUnits(@NotNull List<String> ous, @NotNull List<String> regions) Create stack instances in all accounts in a set of Organizational Units (OUs) and regions passed as literal lists.If you want to deploy to Organization Units, you must choose have created the StackSet with
deploymentModel: DeploymentModel.organizations()
.Stack Instances will be created in every combination of region and account.
NOTE:
StackInstances.inAccounts()
andStackInstances.inOrganizationalUnits()
have exactly the same behavior, and you can use them interchangeably if you want. The only difference between them is that your code clearly indicates what entity it's working with.- Parameters:
ous
- This parameter is required.regions
- This parameter is required.
-