Skip to content
v2.274.0

StackSetTemplate Class ​

The source of a StackSet template.

Example ​

ts
declare const pipeline: codepipeline.Pipeline;
declare const sourceOutput: codepipeline.Artifact;

pipeline.addStage({
  stageName: 'DeployStackSets',
  actions: [
    // First, update the StackSet itself with the newest template
    new codepipeline_actions.CloudFormationDeployStackSetAction({
      actionName: 'UpdateStackSet',
      runOrder: 1,
      stackSetName: 'MyStackSet',
      template: codepipeline_actions.StackSetTemplate.fromArtifactPath(sourceOutput.atPath('template.yaml')),

      // Change this to 'StackSetDeploymentModel.organizations()' if you want to deploy to OUs
      deploymentModel: codepipeline_actions.StackSetDeploymentModel.selfManaged(),
      // This deploys to a set of accounts
      stackInstances: codepipeline_actions.StackInstances.inAccounts(['111111111111'], ['us-east-1', 'eu-west-1']),
    }),

    // Afterwards, update/create additional instances in other accounts
    new codepipeline_actions.CloudFormationDeployStackInstancesAction({
      actionName: 'AddMoreInstances',
      runOrder: 2,
      stackSetName: 'MyStackSet',
      stackInstances: codepipeline_actions.StackInstances.inAccounts(
        ['222222222222', '333333333333'],
        ['us-east-1', 'eu-west-1']
      ),
    }),
  ],
});

Initializer ​

ts
new StackSetTemplate()
python
StackSetTemplate()
java
new StackSetTemplate()
csharp
new StackSetTemplate()
go
NewStackSetTemplate()

Methods ​

fromArtifactPath(artifactPath: ArtifactPath): StackSetTemplate // chainable@staticmethod def from_artifact_path(artifact_path: ArtifactPath) -> StackSetTemplatepublic static StackSetTemplate fromArtifactPath(ArtifactPath artifactPath)public static StackSetTemplate FromArtifactPath(ArtifactPath artifactPath)func FromArtifactPath(ArtifactPath ArtifactPath) StackSetTemplatestatic#
Use a file in an artifact as Stack Template.