AWS CloudFormation Stack Set
This page shows how to write Terraform and CloudFormation for CloudFormation Stack Set and write them securely.
aws_cloudformation_stack_set (Terraform)
The Stack Set in CloudFormation can be configured in Terraform with the resource name aws_cloudformation_stack_set
. The following sections describe 4 examples of how to use the resource and its parameters.
Example Usage from GitHub
resource "aws_cloudformation_stack_set" "withTemplBodyAWS" {
name = "networking-stack"
parameters = {
VPCCidr = "10.0.0.0/16"
}
resource "aws_cloudformation_stack_set" "withTemplBodyAWS" {
name = "networking-stack"
parameters = {
VPCCidr = "10.0.0.0/16"
}
resource "aws_cloudformation_stack_set" "stack_set" {
count = length(var.stack_set)
administration_role_arn = element(var.administration_role_arn, lookup(var.stack_set[count.index], "administration_role_id"))
name = lookup(var.stack_set[count.index], "name")
capabilities = lookup(var.stack_set[count.index], "capabilities")
description = lookup(var.stack_set[count.index], "description")
resource "aws_cloudformation_stack_set" "this" {
administration_role_arn = var.administration_role_arn
capabilities = var.capabilities
description = var.description
execution_role_name = var.execution_role_name
name = var.name
Parameters
-
administration_role_arn
optional - string -
arn
optional computed - string -
capabilities
optional - set of string -
description
optional - string -
execution_role_name
optional computed - string -
id
optional computed - string -
name
required - string -
parameters
optional - map from string to string -
permission_model
optional - string -
stack_set_id
optional computed - string -
tags
optional - map from string to string -
template_body
optional computed - string -
template_url
optional - string -
auto_deployment
list block-
enabled
optional - bool -
retain_stacks_on_account_removal
optional - bool
-
-
timeouts
single block-
update
optional - string
-
Explanation in Terraform Registry
Manages a CloudFormation StackSet. StackSets allow CloudFormation templates to be easily deployed across multiple accounts and regions via StackSet Instances (
aws_cloudformation_stack_set_instance
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 thelifecycle
configuration blockignore_changes
argument. NOTE: AllNoEcho
template parameters must be ignored with thelifecycle
configuration blockignore_changes
argument.
AWS::CloudFormation::StackSet (CloudFormation)
The StackSet in CloudFormation can be configured in CloudFormation with the resource name AWS::CloudFormation::StackSet
. The following sections describe how to use the resource and its parameters.
Example Usage from GitHub
An example could not be found in GitHub.
Parameters
-
StackSetName
required - String -
AdministrationRoleARN
optional - String -
AutoDeployment
optional - AutoDeployment -
Capabilities
optional - List -
Description
optional - String -
ExecutionRoleName
optional - String -
OperationPreferences
optional - OperationPreferences -
StackInstancesGroup
optional - List of StackInstances -
Parameters
optional - List of Parameter -
PermissionModel
required - String -
Tags
optional - List of Tag -
TemplateBody
optional - String -
TemplateURL
optional - String -
CallAs
optional - String
Explanation in CloudFormation Registry
The
AWS::CloudFormation::StackSet
enables you to provision stacks into AWS accounts and across Regions by using a single CloudFormation template. In the stack set, you specify the template to use, as well as any parameters and capabilities that the template requires.
Frequently asked questions
What is AWS CloudFormation Stack Set?
AWS CloudFormation Stack Set is a resource for CloudFormation of Amazon Web Service. Settings can be wrote in Terraform and CloudFormation.
Where can I find the example code for the AWS CloudFormation Stack Set?
For Terraform, the gilyas/infracost, infracost/infracost and mikamakusa/terraform source code examples are useful. See the Terraform Example section for further details.