Menu
AWS CloudFormation
API Reference (API Version 2010-05-15)

CreateStackInstances

Creates stack instances for the specified accounts, within the specified regions. A stack instance refers to a stack in a specific account and region. Accounts and Regions are required parameters—you must specify at least one account and one region.

Request Parameters

For information about the parameters that are common to all actions, see Common Parameters.

Accounts.member.N

The names of one or more AWS accounts that you want to create stack instances in the specified region(s) for.

Type: Array of strings

Pattern: [0-9]{12}

Required: Yes

OperationId

The unique identifier for this stack set operation.

The operation ID also functions as an idempotency token, to ensure that AWS CloudFormation performs the stack set operation only once, even if you retry the request multiple times. You might retry stack set operation requests to ensure that AWS CloudFormation successfully received them.

Repeating this stack set operation with a new operation ID retries all stack instances whose status is OUTDATED.

Type: String

Length Constraints: Minimum length of 1. Maximum length of 128.

Pattern: [a-zA-Z0-9][-a-zA-Z0-9]*

Required: No

OperationPreferences

Preferences for how AWS CloudFormation performs this stack set operation.

Type: StackSetOperationPreferences object

Required: No

ParameterOverrides.member.N

A list of stack set parameters whose values you want to override in the selected stack instances.

Any overridden parameter values will be applied to all stack instances in the specified accounts and regions. When specifying parameters and their values, be aware of how AWS CloudFormation sets parameter values during stack instance operations:

  • To override the current value for a parameter, include the parameter and specify its value.

  • To leave a parameter set to its present value, you can do one of the following:

    • Do not include the parameter in the list.

    • Include the parameter and specify UsePreviousValue as true. (You cannot specify both a value and set UsePreviousValue to true.)

  • To set all overridden parameter back to the values specified in the stack set, specify a parameter list but do not include any parameters.

  • To leave all parameters set to their present values, do not specify this property at all.

During stack set updates, any parameter values overridden for a stack instance are not updated, but retain their overridden value.

You can only override the parameter values that are specified in the stack set; to add or delete a parameter itself, use UpdateStackSet to update the stack set template.

Type: Array of Parameter objects

Required: No

Regions.member.N

The names of one or more regions where you want to create stack instances using the specified AWS account(s).

Type: Array of strings

Required: Yes

StackSetName

The name or unique ID of the stack set that you want to create stack instances from.

Type: String

Required: Yes

Response Elements

The following element is returned by the service.

OperationId

The unique identifier for this stack set operation.

Type: String

Length Constraints: Minimum length of 1. Maximum length of 128.

Pattern: [a-zA-Z0-9][-a-zA-Z0-9]*

Errors

For information about the errors that are common to all actions, see Common Errors.

InvalidOperation

The specified operation isn't valid.

HTTP Status Code: 400

LimitExceeded

The quota for the resource has already been reached.

For information on stack set limitations, see Limitations of StackSets.

HTTP Status Code: 400

OperationIdAlreadyExists

The specified operation ID already exists.

HTTP Status Code: 409

OperationInProgress

Another operation is currently in progress for this stack set. Only one operation can be performed for a stack set at a given time.

HTTP Status Code: 409

StackSetNotFound

The specified stack set doesn't exist.

HTTP Status Code: 404

StaleRequest

Another operation has been performed on this stack set since the specified operation was performed.

HTTP Status Code: 409

Example

CreateStackInstances

Sample Request


https://cloudformation.us-east-1.amazonaws.com/
 ?Action=CreateStackInstances
 &Version=2010-05-15
 &StackSetName=stack-set-example
 &Regions.member.1=us-east-1
 &Regions.member.2=us-west-2
 &OperationPreferences.MaxConcurrentCount=5
 &OperationPreferences.FailureTolerancePercentage=10
 &Accounts.member.1=[account]
 &Accounts.member.2=[account]
 &OperationId=c424b651-2fda-4d6f-a4f1-20c0example
 &X-Amz-Algorithm=AWS4-HMAC-SHA256
 &X-Amz-Credential=[Access key ID and scope]
 &X-Amz-Date=20170810T233349Z
 &X-Amz-SignedHeaders=content-type;host
 &X-Amz-Signature=[Signature]
         

Sample Response


<CreateStackInstancesResponse xmlns="http://internal.amazon.com/coral/com.amazonaws.maestro.service.v20160713/">
  <CreateStackInstancesResult>
    <OperationId>c424b651-2fda-4d6f-a4f1-20c0fc62a6fe</OperationId>
  </CreateStackInstancesResult>
  <ResponseMetadata>
    <RequestId>97564c5e-813e-11e7-a9b2-5b163763e702</RequestId>
  </ResponseMetadata>
</CreateStackInstancesResponse>
         
         

See Also

For more information about using this API in one of the language-specific AWS SDKs, see the following: