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

cloudformation_stack_set_test.tf#L12
resource "aws_cloudformation_stack_set" "withTemplBodyAWS" {
  name = "networking-stack"

  parameters = {
    VPCCidr = "10.0.0.0/16"
  }
cloudformation_stack_set_test.tf#L12
resource "aws_cloudformation_stack_set" "withTemplBodyAWS" {
  name = "networking-stack"

  parameters = {
    VPCCidr = "10.0.0.0/16"
  }
main.tf#L1
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")
main.tf#L7
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

Review your Terraform file for AWS best practices

Shisho Cloud, our free checker to make sure your Terraform configuration follows best practices, is available (beta).

Parameters

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 the lifecycle configuration block ignore_changes argument. NOTE: All NoEcho template parameters must be ignored with the lifecycle configuration block ignore_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

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.