Skip to main content
Control Tower 0.0.24

Control Tower Multi-Account Factory

View SourceRelease Notes

This is a Terraform module that will trigger the creation of multiple new AWS accounts by using Control Tower. Under the hood, this module uses the control-tower-account-factory module.

Sample Usage

main.tf

# ------------------------------------------------------------------------------------------------------
# DEPLOY GRUNTWORK'S CONTROL-TOWER-MULTI-ACCOUNT-FACTORY MODULE
# ------------------------------------------------------------------------------------------------------

module "control_tower_multi_account_factory" {

source = "git::git@github.com:gruntwork-io/terraform-aws-control-tower.git//modules/landingzone/control-tower-multi-account-factory?ref=v0.0.24"

# ----------------------------------------------------------------------------------------------------
# REQUIRED VARIABLES
# ----------------------------------------------------------------------------------------------------

# The absolute path to the folder to look for new account request files. Each
# file should be named account-<NAME>.yml, where NAME is the name of an
# account to create. Within the YAML file, you must define the following
# fields: account_email (Account email, must be globally unique across all AWS
# Accounts), sso_user_first_name (The first name of the user who will be
# granted admin access to this new account through AWS SSO),
# sso_user_last_name (The last name of the user who will be granted admin
# access to this new account through AWS SSO), sso_user_email (The email
# address of the user who will be granted admin access to this new account
# through AWS SSO), organizational_unit_name (The name of the organizational
# unit or OU in which this account should be created—must be one of the OUs
# enrolled in Control Tower).
account_requests_folder = <string>

# ----------------------------------------------------------------------------------------------------
# OPTIONAL VARIABLES
# ----------------------------------------------------------------------------------------------------

# If specified, this is assumed to be the absolute file path of a YAML file
# where the details of the new accounts created by this module will be written
# (if the file already exists, the module will merge its data into the file).
# The expected format of this YAML file is that the keys are the account names
# and the values are objects with the following keys: id (the account ID),
# email (the root user email address for the account).
accounts_yaml_path = null

# The ID of the AWS Control Tower Account Factory provisioning artifact in AWS
# Service Catalog to use. On initial creation, we are able to look this up
# automatically by name, but due to a Terraform or AWS bug
# (https://github.com/hashicorp/terraform-provider-aws/issues/24362), the
# lookup fails if you try to modify the account creation details (e.g., you
# try to modify the SSO user details after the account has been created). In
# those cases, you have to look up the ID manually by going to the Product
# List in the AWS Service Catalog console
# (https://console.aws.amazon.com/servicecatalog/home#admin-products),
# clicking the 'AWS Control Tower Account Factory' product, and grabbing the
# ID of the latest product version from the Product Versions table at the
# bottom.
provisioning_artifact_id = null

}


Reference

Required

The absolute path to the folder to look for new account request files. Each file should be named account-<NAME>.yml, where NAME is the name of an account to create. Within the YAML file, you must define the following fields: account_email (Account email, must be globally unique across all AWS Accounts), sso_user_first_name (The first name of the user who will be granted admin access to this new account through AWS SSO), sso_user_last_name (The last name of the user who will be granted admin access to this new account through AWS SSO), sso_user_email (The email address of the user who will be granted admin access to this new account through AWS SSO), organizational_unit_name (The name of the organizational unit or OU in which this account should be created—must be one of the OUs enrolled in Control Tower).

Optional

accounts_yaml_pathstringoptional

If specified, this is assumed to be the absolute file path of a YAML file where the details of the new accounts created by this module will be written (if the file already exists, the module will merge its data into the file). The expected format of this YAML file is that the keys are the account names and the values are objects with the following keys: id (the account ID), email (the root user email address for the account).

null

The ID of the AWS Control Tower Account Factory provisioning artifact in AWS Service Catalog to use. On initial creation, we are able to look this up automatically by name, but due to a Terraform or AWS bug (https://github.com/hashicorp/terraform-provider-aws/issues/24362), the lookup fails if you try to modify the account creation details (e.g., you try to modify the SSO user details after the account has been created). In those cases, you have to look up the ID manually by going to the Product List in the AWS Service Catalog console (https://console.aws.amazon.com/servicecatalog/home#admin-products), clicking the 'AWS Control Tower Account Factory' product, and grabbing the ID of the latest product version from the Product Versions table at the bottom.

null