aws-cdk-lib.aws_codepipeline_actions.StackSetTemplate

class StackSetTemplate

LanguageType name
.NETAmazon.CDK.AWS.CodePipeline.Actions.StackSetTemplate
Gogithub.com/aws/aws-cdk-go/awscdk/v2/awscodepipelineactions#StackSetTemplate
Javasoftware.amazon.awscdk.services.codepipeline.actions.StackSetTemplate
Pythonaws_cdk.aws_codepipeline_actions.StackSetTemplate
TypeScript (source)aws-cdk-lib » aws_codepipeline_actions » StackSetTemplate

The source of a StackSet template.

Example

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

new StackSetTemplate()

Methods

NameDescription
static fromArtifactPath(artifactPath)Use a file in an artifact as Stack Template.

static fromArtifactPath(artifactPath)

public static fromArtifactPath(artifactPath: ArtifactPath): StackSetTemplate

Parameters

  • artifactPath ArtifactPath

Returns

  • StackSetTemplate

Use a file in an artifact as Stack Template.