awscc_cloudformation_stack_set (Resource)

StackSet as a resource provides one-click experience for provisioning a StackSet and StackInstances

Example Usage

Basic StackSet Usage

To Create a basic StackSet (Self-Managed Permissions)

resource "awscc_cloudformation_stack_set" "stackset" {
  stack_set_name = "network-stackset"

  permission_model = "SELF_MANAGED"

  template_body = jsonencode({

    Resources = {
      myVpc = {
        Type = "AWS::EC2::VPC"
        Properties = {
          CidrBlock = "10.0.0.0/16"
          Tags = [
            {
              Key   = "Name"
              Value = "Primary_CF_VPC"
            }
          ]
        }
      }
    }
  })
}

Advanced StackSet Usage

_NOTE:_ Please make sure you Enable all features in AWS Organizations and Activate trusted access with AWS Organizations before deploying a Stackset with service-managed permissions. Please refer to the following documentation for more infomration: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/stacksets-orgs-activate-trusted-access.html

To Create a StackSet with Service-Managed Permissions

resource "awscc_cloudformation_stack_set" "stackset" {
  stack_set_name   = "network-stackset"
  permission_model = "SERVICE_MANAGED"
  auto_deployment = {
    enabled                          = true
    retain_stacks_on_account_removal = false
  }

  template_body = jsonencode({
    Resources = {
      myVpc = {
        Type = "AWS::EC2::VPC"
        Properties = {
          CidrBlock = "10.0.0.0/16"
          Tags = [
            {
              Key   = "Name"
              Value = "Primary_CF_VPC"
            }
          ]
        }
      }
    }
  })
}

Schema

Required

Optional

Read-Only

Nested Schema for auto_deployment

Optional:

Nested Schema for managed_execution

Optional:

Nested Schema for operation_preferences

Optional:

Nested Schema for parameters

Required:

Nested Schema for stack_instances_group

Required:

Optional:

Nested Schema for stack_instances_group.deployment_targets

Optional:

Nested Schema for stack_instances_group.parameter_overrides

Required:

Nested Schema for tags

Required:

Import

Import is supported using the following syntax:

$ terraform import awscc_cloudformation_stack_set.example <resource ID>