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_nameargument in theaws.cloudformation.StackSetresource) 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_stackhas been set totruein 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
new StackSetInstance(name: string, args: StackSetInstanceArgs, opts?: CustomResourceOptions);def StackSetInstance(resource_name, opts=None, account_id=None, parameter_overrides=None, region=None, retain_stack=None, stack_set_name=None, __props__=None);func NewStackSetInstance(ctx *Context, name string, args StackSetInstanceArgs, opts ...ResourceOption) (*StackSetInstance, error)public StackSetInstance(string name, StackSetInstanceArgs args, CustomResourceOptions? opts = null)- 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:
- Stack
Set stringName Name of the StackSet.
- Account
Id string Target AWS Account ID to create a Stack based on the StackSet. Defaults to current account.
- Parameter
Overrides 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.
- 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
Set stringName Name of the StackSet.
- Account
Id string Target AWS Account ID to create a Stack based on the StackSet. Defaults to current account.
- Parameter
Overrides 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.
- 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
Set stringName Name of the StackSet.
- account
Id string Target AWS Account ID to create a Stack based on the StackSet. Defaults to current account.
- parameter
Overrides {[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.
- retain
Stack 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_ strname 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:
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): StackSetInstancestatic 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:
- Account
Id string Target AWS Account ID to create a Stack based on the StackSet. Defaults to current account.
- Parameter
Overrides 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.
- 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 string Stack identifier
- Stack
Set stringName Name of the StackSet.
- Account
Id string Target AWS Account ID to create a Stack based on the StackSet. Defaults to current account.
- Parameter
Overrides 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.
- 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 string Stack identifier
- Stack
Set stringName Name of the StackSet.
- account
Id string Target AWS Account ID to create a Stack based on the StackSet. Defaults to current account.
- parameter
Overrides {[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.
- retain
Stack 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
Id string Stack identifier
- stack
Set stringName 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_ strname 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
awsTerraform Provider.