Show / Hide Table of Contents

Class StackSet

Manages a CloudFormation StackSet. StackSets allow CloudFormation templates to be easily deployed across multiple accounts and regions via StackSet Instances (aws.cloudformation.StackSetInstance resource). Additional information about StackSets can be found in the AWS CloudFormation User Guide.

NOTE: All template parameters, including those with a Default, must be configured or ignored with the lifecycle configuration block ignore_changes argument.

NOTE: All NoEcho template parameters must be ignored with the lifecycle configuration block ignore_changes argument.

Example Usage

using Pulumi;
using Aws = Pulumi.Aws;

class MyStack : Stack
{
public MyStack()
{
    var aWSCloudFormationStackSetAdministrationRoleAssumeRolePolicy = Output.Create(Aws.Iam.GetPolicyDocument.InvokeAsync(new Aws.Iam.GetPolicyDocumentArgs
    {
        Statements = 
        {
            new Aws.Iam.Inputs.GetPolicyDocumentStatementArgs
            {
                Actions = 
                {
                    "sts:AssumeRole",
                },
                Effect = "Allow",
                Principals = 
                {
                    new Aws.Iam.Inputs.GetPolicyDocumentStatementPrincipalArgs
                    {
                        Identifiers = 
                        {
                            "cloudformation.amazonaws.com",
                        },
                        Type = "Service",
                    },
                },
            },
        },
    }));
    var aWSCloudFormationStackSetAdministrationRole = new Aws.Iam.Role("aWSCloudFormationStackSetAdministrationRole", new Aws.Iam.RoleArgs
    {
        AssumeRolePolicy = aWSCloudFormationStackSetAdministrationRoleAssumeRolePolicy.Apply(aWSCloudFormationStackSetAdministrationRoleAssumeRolePolicy => aWSCloudFormationStackSetAdministrationRoleAssumeRolePolicy.Json),
    });
    var example = new Aws.CloudFormation.StackSet("example", new Aws.CloudFormation.StackSetArgs
    {
        AdministrationRoleArn = aWSCloudFormationStackSetAdministrationRole.Arn,
        Parameters = 
        {
            { "VPCCidr", "10.0.0.0/16" },
        },
        TemplateBody = @"{
""Parameters"" : {
""VPCCidr"" : {
  ""Type"" : ""String"",
  ""Default"" : ""10.0.0.0/16"",
  ""Description"" : ""Enter the CIDR block for the VPC. Default is 10.0.0.0/16.""
}
},
""Resources"" : {
""myVpc"": {
  ""Type"" : ""AWS::EC2::VPC"",
  ""Properties"" : {
    ""CidrBlock"" : { ""Ref"" : ""VPCCidr"" },
    ""Tags"" : [
      {""Key"": ""Name"", ""Value"": ""Primary_CF_VPC""}
    ]
  }
}
}
}

",
    });
    var aWSCloudFormationStackSetAdministrationRoleExecutionPolicyPolicyDocument = example.ExecutionRoleName.Apply(executionRoleName => Aws.Iam.GetPolicyDocument.InvokeAsync(new Aws.Iam.GetPolicyDocumentArgs
    {
        Statements = 
        {
            new Aws.Iam.Inputs.GetPolicyDocumentStatementArgs
            {
                Actions = 
                {
                    "sts:AssumeRole",
                },
                Effect = "Allow",
                Resources = 
                {
                    $"arn:aws:iam::*:role/{executionRoleName}",
                },
            },
        },
    }));
    var aWSCloudFormationStackSetAdministrationRoleExecutionPolicyRolePolicy = new Aws.Iam.RolePolicy("aWSCloudFormationStackSetAdministrationRoleExecutionPolicyRolePolicy", new Aws.Iam.RolePolicyArgs
    {
        Policy = aWSCloudFormationStackSetAdministrationRoleExecutionPolicyPolicyDocument.Apply(aWSCloudFormationStackSetAdministrationRoleExecutionPolicyPolicyDocument => aWSCloudFormationStackSetAdministrationRoleExecutionPolicyPolicyDocument.Json),
        Role = aWSCloudFormationStackSetAdministrationRole.Name,
    });
}

}
Inheritance
System.Object
Resource
CustomResource
StackSet
Inherited Members
CustomResource.Id
Resource.GetResourceType()
Resource.GetResourceName()
Resource.Urn
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: Pulumi.Aws.CloudFormation
Assembly: Pulumi.Aws.dll
Syntax
public class StackSet : CustomResource

Constructors

View Source

StackSet(String, StackSetArgs, CustomResourceOptions)

Create a StackSet resource with the given unique name, arguments, and options.

Declaration
public StackSet(string name, StackSetArgs args, CustomResourceOptions options = null)
Parameters
Type Name Description
System.String name

The unique name of the resource

StackSetArgs args

The arguments used to populate this resource's properties

CustomResourceOptions options

A bag of options that control this resource's behavior

Properties

View Source

AdministrationRoleArn

Amazon Resource Number (ARN) of the IAM Role in the administrator account.

Declaration
public Output<string> AdministrationRoleArn { get; }
Property Value
Type Description
Output<System.String>
View Source

Arn

Amazon Resource Name (ARN) of the StackSet.

Declaration
public Output<string> Arn { get; }
Property Value
Type Description
Output<System.String>
View Source

Capabilities

A list of capabilities. Valid values: CAPABILITY_IAM, CAPABILITY_NAMED_IAM, CAPABILITY_AUTO_EXPAND.

Declaration
public Output<ImmutableArray<string>> Capabilities { get; }
Property Value
Type Description
Output<System.Collections.Immutable.ImmutableArray<System.String>>
View Source

Description

Description of the StackSet.

Declaration
public Output<string> Description { get; }
Property Value
Type Description
Output<System.String>
View Source

ExecutionRoleName

Name of the IAM Role in all target accounts for StackSet operations. Defaults to AWSCloudFormationStackSetExecutionRole.

Declaration
public Output<string> ExecutionRoleName { get; }
Property Value
Type Description
Output<System.String>
View Source

Name

Name of the StackSet. The name must be unique in the region where you create your StackSet. The name can contain only alphanumeric characters (case-sensitive) and hyphens. It must start with an alphabetic character and cannot be longer than 128 characters.

Declaration
public Output<string> Name { get; }
Property Value
Type Description
Output<System.String>
View Source

Parameters

Key-value map of input parameters for the StackSet template. All template parameters, including those with a Default, must be configured or ignored with lifecycle configuration block ignore_changes argument. All NoEcho template parameters must be ignored with the lifecycle configuration block ignore_changes argument.

Declaration
public Output<ImmutableDictionary<string, string>> Parameters { get; }
Property Value
Type Description
Output<System.Collections.Immutable.ImmutableDictionary<System.String, System.String>>
View Source

StackSetId

Unique identifier of the StackSet.

Declaration
public Output<string> StackSetId { get; }
Property Value
Type Description
Output<System.String>
View Source

Tags

Key-value map of tags to associate with this StackSet and the Stacks created from it. AWS CloudFormation also propagates these tags to supported resources that are created in the Stacks. A maximum number of 50 tags can be specified.

Declaration
public Output<ImmutableDictionary<string, object>> Tags { get; }
Property Value
Type Description
Output<System.Collections.Immutable.ImmutableDictionary<System.String, System.Object>>
View Source

TemplateBody

String containing the CloudFormation template body. Maximum size: 51,200 bytes. Conflicts with template_url.

Declaration
public Output<string> TemplateBody { get; }
Property Value
Type Description
Output<System.String>
View Source

TemplateUrl

String containing the location of a file containing the CloudFormation template body. The URL must point to a template that is located in an Amazon S3 bucket. Maximum location file size: 460,800 bytes. Conflicts with template_body.

Declaration
public Output<string> TemplateUrl { get; }
Property Value
Type Description
Output<System.String>

Methods

View Source

Get(String, Input<String>, StackSetState, CustomResourceOptions)

Get an existing StackSet resource's state with the given name, ID, and optional extra properties used to qualify the lookup.

Declaration
public static StackSet Get(string name, Input<string> id, StackSetState state = null, CustomResourceOptions options = null)
Parameters
Type Name Description
System.String name

The unique name of the resulting resource.

Input<System.String> id

The unique provider ID of the resource to lookup.

StackSetState state

Any extra arguments used during the lookup.

CustomResourceOptions options

A bag of options that control this resource's behavior

Returns
Type Description
StackSet
  • View Source
Back to top Copyright 2016-2020, Pulumi Corporation.