From 886dbe7a16eb0fb2592fafa78acf696e190f5e89 Mon Sep 17 00:00:00 2001 From: Evans Tucker Date: Thu, 1 Aug 2024 09:17:35 -0700 Subject: [PATCH] fix: Adding an example for accounts that already have an IAM account alias --- README.md | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/README.md b/README.md index 50a4a93..943b5a1 100644 --- a/README.md +++ b/README.md @@ -11,6 +11,8 @@ If the AWS account you are using already has a Terraform state bucket and lockin ## Usage for bootstrapping +For AWS accounts that don't have an IAM account alias: + ```hcl module "bootstrap" { source = "trussworks/bootstrap/aws" @@ -19,6 +21,19 @@ module "bootstrap" { account_alias = "-" } ``` +If the account already has an alias, use this: + +```hcl +data "aws_iam_account_alias" "current" {} + +module "bootstrap" { + source = "trussworks/bootstrap/aws" + + region = "us-west-2" + account_alias = data.aws_iam_account_alias.current.id + manage_account_alias = false +} +``` ## Requirements