StackSetInstance

Manages a CloudFormation StackSet Instance. Instances are managed in the account and region of the StackSet after the target account permissions have been configured. Additional information about StackSets can be found in the AWS CloudFormation User Guide.

NOTE: All target accounts must have an IAM Role created that matches the name of the execution role configured in the StackSet (the execution_role_name argument in the aws.cloudformation.StackSet resource) in a trust relationship with the administrative account or administration IAM Role. The execution role must have appropriate permissions to manage resources defined in the template along with those required for StackSets to operate. See the AWS CloudFormation User Guide for more details.

NOTE: To retain the Stack during resource destroy, ensure retain_stack has been set to true in the state first. This must be completed before a deployment that would destroy the resource.

Example Usage

using Pulumi;
using Aws = Pulumi.Aws;

class MyStack : Stack
{
    public MyStack()
    {
        var example = new Aws.CloudFormation.StackSetInstance("example", new Aws.CloudFormation.StackSetInstanceArgs
        {
            AccountId = "123456789012",
            Region = "us-east-1",
            StackSetName = aws_cloudformation_stack_set.Example.Name,
        });
    }

}
package main

import (
    "github.com/pulumi/pulumi-aws/sdk/v2/go/aws/cloudformation"
    "github.com/pulumi/pulumi/sdk/v2/go/pulumi"
)

func main() {
    pulumi.Run(func(ctx *pulumi.Context) error {
        _, err := cloudformation.NewStackSetInstance(ctx, "example", &cloudformation.StackSetInstanceArgs{
            AccountId:    pulumi.String("123456789012"),
            Region:       pulumi.String("us-east-1"),
            StackSetName: pulumi.String(aws_cloudformation_stack_set.Example.Name),
        })
        if err != nil {
            return err
        }
        return nil
    })
}
import pulumi
import pulumi_aws as aws

example = aws.cloudformation.StackSetInstance("example",
    account_id="123456789012",
    region="us-east-1",
    stack_set_name=aws_cloudformation_stack_set["example"]["name"])
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";

const example = new aws.cloudformation.StackSetInstance("example", {
    accountId: "123456789012",
    region: "us-east-1",
    stackSetName: aws_cloudformation_stack_set_example.name,
});

Create a StackSetInstance Resource

def StackSetInstance(resource_name, opts=None, account_id=None, parameter_overrides=None, region=None, retain_stack=None, stack_set_name=None, __props__=None);
name string
The unique name of the resource.
args StackSetInstanceArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name str
The unique name of the resource.
opts ResourceOptions
A bag of options that control this resource's behavior.
ctx Context
Context object for the current deployment.
name string
The unique name of the resource.
args StackSetInstanceArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name string
The unique name of the resource.
args StackSetInstanceArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.

StackSetInstance Resource Properties

To learn more about resource properties and how to use them, see Inputs and Outputs in the Programming Model docs.

Inputs

The StackSetInstance resource accepts the following input properties:

StackSetName string

Name of the StackSet.

AccountId string

Target AWS Account ID to create a Stack based on the StackSet. Defaults to current account.

ParameterOverrides Dictionary<string, string>

Key-value map of input parameters to override from the StackSet for this Instance.

Region string

Target AWS Region to create a Stack based on the StackSet. Defaults to current region.

RetainStack bool

During resource destroy, remove Instance from StackSet while keeping the Stack and its associated resources. Must be enabled in the state before destroy operation to take effect. You cannot reassociate a retained Stack or add an existing, saved Stack to a new StackSet. Defaults to false.

StackSetName string

Name of the StackSet.

AccountId string

Target AWS Account ID to create a Stack based on the StackSet. Defaults to current account.

ParameterOverrides map[string]string

Key-value map of input parameters to override from the StackSet for this Instance.

Region string

Target AWS Region to create a Stack based on the StackSet. Defaults to current region.

RetainStack bool

During resource destroy, remove Instance from StackSet while keeping the Stack and its associated resources. Must be enabled in the state before destroy operation to take effect. You cannot reassociate a retained Stack or add an existing, saved Stack to a new StackSet. Defaults to false.

stackSetName string

Name of the StackSet.

accountId string

Target AWS Account ID to create a Stack based on the StackSet. Defaults to current account.

parameterOverrides {[key: string]: string}

Key-value map of input parameters to override from the StackSet for this Instance.

region string

Target AWS Region to create a Stack based on the StackSet. Defaults to current region.

retainStack boolean

During resource destroy, remove Instance from StackSet while keeping the Stack and its associated resources. Must be enabled in the state before destroy operation to take effect. You cannot reassociate a retained Stack or add an existing, saved Stack to a new StackSet. Defaults to false.

stack_set_name str

Name of the StackSet.

account_id str

Target AWS Account ID to create a Stack based on the StackSet. Defaults to current account.

parameter_overrides Dict[str, str]

Key-value map of input parameters to override from the StackSet for this Instance.

region str

Target AWS Region to create a Stack based on the StackSet. Defaults to current region.

retain_stack bool

During resource destroy, remove Instance from StackSet while keeping the Stack and its associated resources. Must be enabled in the state before destroy operation to take effect. You cannot reassociate a retained Stack or add an existing, saved Stack to a new StackSet. Defaults to false.

Outputs

All input properties are implicitly available as output properties. Additionally, the StackSetInstance resource produces the following output properties:

Id string
The provider-assigned unique ID for this managed resource.
StackId string

Stack identifier

Id string
The provider-assigned unique ID for this managed resource.
StackId string

Stack identifier

id string
The provider-assigned unique ID for this managed resource.
stackId string

Stack identifier

id str
The provider-assigned unique ID for this managed resource.
stack_id str

Stack identifier

Look up an Existing StackSetInstance Resource

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

public static get(name: string, id: Input<ID>, state?: StackSetInstanceState, opts?: CustomResourceOptions): StackSetInstance
static get(resource_name, id, opts=None, account_id=None, parameter_overrides=None, region=None, retain_stack=None, stack_id=None, stack_set_name=None, __props__=None);
func GetStackSetInstance(ctx *Context, name string, id IDInput, state *StackSetInstanceState, opts ...ResourceOption) (*StackSetInstance, error)
public static StackSetInstance Get(string name, Input<string> id, StackSetInstanceState? state, CustomResourceOptions? opts = null)
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
resource_name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.

The following state arguments are supported:

AccountId string

Target AWS Account ID to create a Stack based on the StackSet. Defaults to current account.

ParameterOverrides Dictionary<string, string>

Key-value map of input parameters to override from the StackSet for this Instance.

Region string

Target AWS Region to create a Stack based on the StackSet. Defaults to current region.

RetainStack bool

During resource destroy, remove Instance from StackSet while keeping the Stack and its associated resources. Must be enabled in the state before destroy operation to take effect. You cannot reassociate a retained Stack or add an existing, saved Stack to a new StackSet. Defaults to false.

StackId string

Stack identifier

StackSetName string

Name of the StackSet.

AccountId string

Target AWS Account ID to create a Stack based on the StackSet. Defaults to current account.

ParameterOverrides map[string]string

Key-value map of input parameters to override from the StackSet for this Instance.

Region string

Target AWS Region to create a Stack based on the StackSet. Defaults to current region.

RetainStack bool

During resource destroy, remove Instance from StackSet while keeping the Stack and its associated resources. Must be enabled in the state before destroy operation to take effect. You cannot reassociate a retained Stack or add an existing, saved Stack to a new StackSet. Defaults to false.

StackId string

Stack identifier

StackSetName string

Name of the StackSet.

accountId string

Target AWS Account ID to create a Stack based on the StackSet. Defaults to current account.

parameterOverrides {[key: string]: string}

Key-value map of input parameters to override from the StackSet for this Instance.

region string

Target AWS Region to create a Stack based on the StackSet. Defaults to current region.

retainStack boolean

During resource destroy, remove Instance from StackSet while keeping the Stack and its associated resources. Must be enabled in the state before destroy operation to take effect. You cannot reassociate a retained Stack or add an existing, saved Stack to a new StackSet. Defaults to false.

stackId string

Stack identifier

stackSetName string

Name of the StackSet.

account_id str

Target AWS Account ID to create a Stack based on the StackSet. Defaults to current account.

parameter_overrides Dict[str, str]

Key-value map of input parameters to override from the StackSet for this Instance.

region str

Target AWS Region to create a Stack based on the StackSet. Defaults to current region.

retain_stack bool

During resource destroy, remove Instance from StackSet while keeping the Stack and its associated resources. Must be enabled in the state before destroy operation to take effect. You cannot reassociate a retained Stack or add an existing, saved Stack to a new StackSet. Defaults to false.

stack_id str

Stack identifier

stack_set_name str

Name of the StackSet.

Package Details

Repository
https://github.com/pulumi/pulumi-aws
License
Apache-2.0
Notes
This Pulumi package is based on the aws Terraform Provider.