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_arnoptional - string -
arnoptional computed - string -
capabilitiesoptional - set of string -
descriptionoptional - string -
execution_role_nameoptional computed - string -
idoptional computed - string -
namerequired - string -
parametersoptional - map from string to string -
permission_modeloptional - string -
stack_set_idoptional computed - string -
tagsoptional - map from string to string -
template_bodyoptional computed - string -
template_urloptional - string -
auto_deploymentlist block-
enabledoptional - bool -
retain_stacks_on_account_removaloptional - bool
-
-
timeoutssingle block-
updateoptional - 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_instanceresource). 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 thelifecycleconfiguration blockignore_changesargument. NOTE: AllNoEchotemplate parameters must be ignored with thelifecycleconfiguration blockignore_changesargument.
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
-
StackSetNamerequired - String -
AdministrationRoleARNoptional - String -
AutoDeploymentoptional - AutoDeployment -
Capabilitiesoptional - List -
Descriptionoptional - String -
ExecutionRoleNameoptional - String -
OperationPreferencesoptional - OperationPreferences -
StackInstancesGroupoptional - List of StackInstances -
Parametersoptional - List of Parameter -
PermissionModelrequired - String -
Tagsoptional - List of Tag -
TemplateBodyoptional - String -
TemplateURLoptional - String -
CallAsoptional - String
Explanation in CloudFormation Registry
The
AWS::CloudFormation::StackSetenables 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.