From 778b0f6712c0458f9fb432523c3820f98373f606 Mon Sep 17 00:00:00 2001 From: cloudneutral Date: Thu, 11 Dec 2025 00:03:26 +0800 Subject: [PATCH 1/6] Fix bootstrap config path resolution --- .../terraform-hcl-standard/aws-cloud/bootstrap/terragrunt.hcl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iac-template/terraform-hcl-standard/aws-cloud/bootstrap/terragrunt.hcl b/iac-template/terraform-hcl-standard/aws-cloud/bootstrap/terragrunt.hcl index c2366d8f..4d72dc3b 100644 --- a/iac-template/terraform-hcl-standard/aws-cloud/bootstrap/terragrunt.hcl +++ b/iac-template/terraform-hcl-standard/aws-cloud/bootstrap/terragrunt.hcl @@ -2,5 +2,5 @@ terraform_version_constraint = ">= 1.2.0" terragrunt_version_constraint = ">= 0.67.14" locals { - bootstrap_config = yamldecode(file("${get_original_terragrunt_dir()}/../config/accounts/bootstrap.yaml")) + bootstrap_config = yamldecode(file(abspath("${get_parent_terragrunt_dir()}/config/accounts/bootstrap.yaml"))) } From af6e9d9b7a419fccdbd73400d67cb05cbf8d58dc Mon Sep 17 00:00:00 2001 From: cloudneutral Date: Thu, 11 Dec 2025 00:10:58 +0800 Subject: [PATCH 2/6] Fix bootstrap config path resolution --- .../terraform-hcl-standard/aws-cloud/bootstrap/terragrunt.hcl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iac-template/terraform-hcl-standard/aws-cloud/bootstrap/terragrunt.hcl b/iac-template/terraform-hcl-standard/aws-cloud/bootstrap/terragrunt.hcl index 4d72dc3b..2e826056 100644 --- a/iac-template/terraform-hcl-standard/aws-cloud/bootstrap/terragrunt.hcl +++ b/iac-template/terraform-hcl-standard/aws-cloud/bootstrap/terragrunt.hcl @@ -2,5 +2,5 @@ terraform_version_constraint = ">= 1.2.0" terragrunt_version_constraint = ">= 0.67.14" locals { - bootstrap_config = yamldecode(file(abspath("${get_parent_terragrunt_dir()}/config/accounts/bootstrap.yaml"))) + bootstrap_config = yamldecode(file(abspath("${get_terragrunt_dir()}/../config/accounts/bootstrap.yaml"))) } From 6edbd4e676adaf078bc9078b2748a184ecc9c853 Mon Sep 17 00:00:00 2001 From: cloudneutral Date: Thu, 11 Dec 2025 00:11:05 +0800 Subject: [PATCH 3/6] Fix bootstrap config path lookup --- .../terraform-hcl-standard/aws-cloud/bootstrap/terragrunt.hcl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iac-template/terraform-hcl-standard/aws-cloud/bootstrap/terragrunt.hcl b/iac-template/terraform-hcl-standard/aws-cloud/bootstrap/terragrunt.hcl index 2e826056..49335045 100644 --- a/iac-template/terraform-hcl-standard/aws-cloud/bootstrap/terragrunt.hcl +++ b/iac-template/terraform-hcl-standard/aws-cloud/bootstrap/terragrunt.hcl @@ -2,5 +2,5 @@ terraform_version_constraint = ">= 1.2.0" terragrunt_version_constraint = ">= 0.67.14" locals { - bootstrap_config = yamldecode(file(abspath("${get_terragrunt_dir()}/../config/accounts/bootstrap.yaml"))) + bootstrap_config = yamldecode(file(find_in_parent_folders("config/accounts/bootstrap.yaml"))) } From 60166ede665341a4ebb0b9b186218350b3082086 Mon Sep 17 00:00:00 2001 From: cloudneutral Date: Thu, 11 Dec 2025 00:16:51 +0800 Subject: [PATCH 4/6] Pass bootstrap config from Terragrunt --- .../aws-cloud/bootstrap/identity/locals.tf | 15 +++++++-------- .../aws-cloud/bootstrap/identity/terragrunt.hcl | 8 ++++++++ .../aws-cloud/bootstrap/identity/variables.tf | 12 ++++++++++++ .../aws-cloud/bootstrap/lock/locals.tf | 2 +- .../aws-cloud/bootstrap/lock/terragrunt.hcl | 1 + .../aws-cloud/bootstrap/lock/variables.tf | 6 ++++++ .../aws-cloud/bootstrap/state/locals.tf | 2 +- .../aws-cloud/bootstrap/state/terragrunt.hcl | 1 + .../aws-cloud/bootstrap/state/variables.tf | 6 ++++++ 9 files changed, 43 insertions(+), 10 deletions(-) diff --git a/iac-template/terraform-hcl-standard/aws-cloud/bootstrap/identity/locals.tf b/iac-template/terraform-hcl-standard/aws-cloud/bootstrap/identity/locals.tf index a9f1bf25..1f3af0b6 100644 --- a/iac-template/terraform-hcl-standard/aws-cloud/bootstrap/identity/locals.tf +++ b/iac-template/terraform-hcl-standard/aws-cloud/bootstrap/identity/locals.tf @@ -1,10 +1,10 @@ locals { - bootstrap = yamldecode(file("${path.module}/../../config/accounts/bootstrap.yaml")) + bootstrap = var.bootstrap - config_account_name = coalesce(var.account_name, local.bootstrap.account_name) - config_region = coalesce(var.region, local.bootstrap.region) - config_role_name = coalesce(var.role_name, local.bootstrap.iam.role_name) - config_terraform_user = coalesce(var.terraform_user_name, local.bootstrap.iam.terraform_user_name) + config_account_name = coalesce(var.account_name, try(local.bootstrap.account_name, null)) + config_region = coalesce(var.region, try(local.bootstrap.region, null)) + config_role_name = coalesce(var.role_name, try(local.bootstrap.iam.role_name, null)) + config_terraform_user = coalesce(var.terraform_user_name, try(local.bootstrap.iam.terraform_user_name, null)) environment = coalesce(try(local.bootstrap.environment, null), try(local.bootstrap.iam.environment, null), "bootstrap") extra_tags = try(local.bootstrap.tags, {}) @@ -15,9 +15,8 @@ locals { } locals { - account_file_path = "${path.module}/../../../config/accounts/${local.config_account_name}.yaml" - account = fileexists(local.account_file_path) ? yamldecode(file(local.account_file_path)) : { - account_id = local.bootstrap.account_id + account = length(var.account) > 0 ? var.account : { + account_id = try(local.bootstrap.account_id, null) environment = local.environment tags = local.extra_tags } diff --git a/iac-template/terraform-hcl-standard/aws-cloud/bootstrap/identity/terragrunt.hcl b/iac-template/terraform-hcl-standard/aws-cloud/bootstrap/identity/terragrunt.hcl index f6706213..329a27cd 100644 --- a/iac-template/terraform-hcl-standard/aws-cloud/bootstrap/identity/terragrunt.hcl +++ b/iac-template/terraform-hcl-standard/aws-cloud/bootstrap/identity/terragrunt.hcl @@ -5,6 +5,12 @@ include "root" { locals { root_config = read_terragrunt_config(find_in_parent_folders()) bootstrap_config = local.root_config.locals.bootstrap_config + account_file = find_in_parent_folders("config/accounts/${local.bootstrap_config.account_name}.yaml", "") + account_config = fileexists(local.account_file) ? yamldecode(file(local.account_file)) : { + account_id = local.bootstrap_config.account_id + environment = try(local.bootstrap_config.environment, "bootstrap") + tags = try(local.bootstrap_config.tags, {}) + } } dependency "state" { @@ -37,4 +43,6 @@ inputs = { region = dependency.state.outputs.region state_bucket_name = dependency.state.outputs.bucket_name state_lock_table_name = dependency.lock.outputs.dynamodb_table_name + bootstrap = local.bootstrap_config + account = local.account_config } diff --git a/iac-template/terraform-hcl-standard/aws-cloud/bootstrap/identity/variables.tf b/iac-template/terraform-hcl-standard/aws-cloud/bootstrap/identity/variables.tf index bcfc31ba..549afd82 100644 --- a/iac-template/terraform-hcl-standard/aws-cloud/bootstrap/identity/variables.tf +++ b/iac-template/terraform-hcl-standard/aws-cloud/bootstrap/identity/variables.tf @@ -73,3 +73,15 @@ variable "state_lock_table_name" { type = string default = null } + +variable "bootstrap" { + description = "Bootstrap configuration provided by Terragrunt" + type = map(any) + default = {} +} + +variable "account" { + description = "Resolved account configuration provided by Terragrunt" + type = map(any) + default = {} +} diff --git a/iac-template/terraform-hcl-standard/aws-cloud/bootstrap/lock/locals.tf b/iac-template/terraform-hcl-standard/aws-cloud/bootstrap/lock/locals.tf index ec47840d..cd71a14a 100644 --- a/iac-template/terraform-hcl-standard/aws-cloud/bootstrap/lock/locals.tf +++ b/iac-template/terraform-hcl-standard/aws-cloud/bootstrap/lock/locals.tf @@ -1,5 +1,5 @@ locals { - bootstrap = yamldecode(file("${path.module}/../../config/accounts/bootstrap.yaml")) + bootstrap = var.bootstrap dynamodb_table_name = coalesce(var.table_name, local.bootstrap.state.dynamodb_table_name) region = coalesce(var.region, local.bootstrap.region) diff --git a/iac-template/terraform-hcl-standard/aws-cloud/bootstrap/lock/terragrunt.hcl b/iac-template/terraform-hcl-standard/aws-cloud/bootstrap/lock/terragrunt.hcl index e56c2204..ce4c3c9a 100644 --- a/iac-template/terraform-hcl-standard/aws-cloud/bootstrap/lock/terragrunt.hcl +++ b/iac-template/terraform-hcl-standard/aws-cloud/bootstrap/lock/terragrunt.hcl @@ -24,4 +24,5 @@ terraform { inputs = { region = dependency.state.outputs.region + bootstrap = local.bootstrap_config } diff --git a/iac-template/terraform-hcl-standard/aws-cloud/bootstrap/lock/variables.tf b/iac-template/terraform-hcl-standard/aws-cloud/bootstrap/lock/variables.tf index a2efe3b3..8474ce27 100644 --- a/iac-template/terraform-hcl-standard/aws-cloud/bootstrap/lock/variables.tf +++ b/iac-template/terraform-hcl-standard/aws-cloud/bootstrap/lock/variables.tf @@ -9,3 +9,9 @@ variable "region" { type = string default = null } + +variable "bootstrap" { + description = "Bootstrap configuration provided by Terragrunt" + type = map(any) + default = {} +} diff --git a/iac-template/terraform-hcl-standard/aws-cloud/bootstrap/state/locals.tf b/iac-template/terraform-hcl-standard/aws-cloud/bootstrap/state/locals.tf index f8412c24..64a1c3d7 100644 --- a/iac-template/terraform-hcl-standard/aws-cloud/bootstrap/state/locals.tf +++ b/iac-template/terraform-hcl-standard/aws-cloud/bootstrap/state/locals.tf @@ -1,5 +1,5 @@ locals { - bootstrap = yamldecode(file("${path.module}/../../config/accounts/bootstrap.yaml")) + bootstrap = var.bootstrap bucket_name = coalesce(var.bucket_name, local.bootstrap.state.bucket_name) region = coalesce(var.region, local.bootstrap.region) diff --git a/iac-template/terraform-hcl-standard/aws-cloud/bootstrap/state/terragrunt.hcl b/iac-template/terraform-hcl-standard/aws-cloud/bootstrap/state/terragrunt.hcl index cac1dd82..1d1be78e 100644 --- a/iac-template/terraform-hcl-standard/aws-cloud/bootstrap/state/terragrunt.hcl +++ b/iac-template/terraform-hcl-standard/aws-cloud/bootstrap/state/terragrunt.hcl @@ -14,4 +14,5 @@ terraform { inputs = { bucket_name = local.bootstrap_config.state.bucket_name region = local.bootstrap_config.region + bootstrap = local.bootstrap_config } diff --git a/iac-template/terraform-hcl-standard/aws-cloud/bootstrap/state/variables.tf b/iac-template/terraform-hcl-standard/aws-cloud/bootstrap/state/variables.tf index e08efbea..f51ac18f 100644 --- a/iac-template/terraform-hcl-standard/aws-cloud/bootstrap/state/variables.tf +++ b/iac-template/terraform-hcl-standard/aws-cloud/bootstrap/state/variables.tf @@ -9,3 +9,9 @@ variable "region" { type = string default = null } + +variable "bootstrap" { + description = "Bootstrap configuration provided by Terragrunt" + type = map(any) + default = {} +} From a4db6e2e13fd912944e845384fc8877f179d1854 Mon Sep 17 00:00:00 2001 From: cloudneutral Date: Thu, 11 Dec 2025 00:28:24 +0800 Subject: [PATCH 5/6] Simplify bootstrap orchestration --- .../aws-cloud/bootstrap/identity/locals.tf | 15 ++++--- .../bootstrap/identity/terragrunt.hcl | 43 ++----------------- .../aws-cloud/bootstrap/identity/variables.tf | 12 ------ .../aws-cloud/bootstrap/lock/locals.tf | 2 +- .../aws-cloud/bootstrap/lock/terragrunt.hcl | 23 ++-------- .../aws-cloud/bootstrap/lock/variables.tf | 6 --- .../aws-cloud/bootstrap/state/locals.tf | 2 +- .../aws-cloud/bootstrap/state/terragrunt.hcl | 13 +----- .../aws-cloud/bootstrap/state/variables.tf | 6 --- .../aws-cloud/bootstrap/terragrunt.hcl | 2 +- 10 files changed, 18 insertions(+), 106 deletions(-) diff --git a/iac-template/terraform-hcl-standard/aws-cloud/bootstrap/identity/locals.tf b/iac-template/terraform-hcl-standard/aws-cloud/bootstrap/identity/locals.tf index 1f3af0b6..a9f1bf25 100644 --- a/iac-template/terraform-hcl-standard/aws-cloud/bootstrap/identity/locals.tf +++ b/iac-template/terraform-hcl-standard/aws-cloud/bootstrap/identity/locals.tf @@ -1,10 +1,10 @@ locals { - bootstrap = var.bootstrap + bootstrap = yamldecode(file("${path.module}/../../config/accounts/bootstrap.yaml")) - config_account_name = coalesce(var.account_name, try(local.bootstrap.account_name, null)) - config_region = coalesce(var.region, try(local.bootstrap.region, null)) - config_role_name = coalesce(var.role_name, try(local.bootstrap.iam.role_name, null)) - config_terraform_user = coalesce(var.terraform_user_name, try(local.bootstrap.iam.terraform_user_name, null)) + config_account_name = coalesce(var.account_name, local.bootstrap.account_name) + config_region = coalesce(var.region, local.bootstrap.region) + config_role_name = coalesce(var.role_name, local.bootstrap.iam.role_name) + config_terraform_user = coalesce(var.terraform_user_name, local.bootstrap.iam.terraform_user_name) environment = coalesce(try(local.bootstrap.environment, null), try(local.bootstrap.iam.environment, null), "bootstrap") extra_tags = try(local.bootstrap.tags, {}) @@ -15,8 +15,9 @@ locals { } locals { - account = length(var.account) > 0 ? var.account : { - account_id = try(local.bootstrap.account_id, null) + account_file_path = "${path.module}/../../../config/accounts/${local.config_account_name}.yaml" + account = fileexists(local.account_file_path) ? yamldecode(file(local.account_file_path)) : { + account_id = local.bootstrap.account_id environment = local.environment tags = local.extra_tags } diff --git a/iac-template/terraform-hcl-standard/aws-cloud/bootstrap/identity/terragrunt.hcl b/iac-template/terraform-hcl-standard/aws-cloud/bootstrap/identity/terragrunt.hcl index 329a27cd..22a292a6 100644 --- a/iac-template/terraform-hcl-standard/aws-cloud/bootstrap/identity/terragrunt.hcl +++ b/iac-template/terraform-hcl-standard/aws-cloud/bootstrap/identity/terragrunt.hcl @@ -2,47 +2,10 @@ include "root" { path = find_in_parent_folders() } -locals { - root_config = read_terragrunt_config(find_in_parent_folders()) - bootstrap_config = local.root_config.locals.bootstrap_config - account_file = find_in_parent_folders("config/accounts/${local.bootstrap_config.account_name}.yaml", "") - account_config = fileexists(local.account_file) ? yamldecode(file(local.account_file)) : { - account_id = local.bootstrap_config.account_id - environment = try(local.bootstrap_config.environment, "bootstrap") - tags = try(local.bootstrap_config.tags, {}) - } -} - -dependency "state" { - config_path = "../state" - - mock_outputs = { - bucket_name = local.bootstrap_config.state.bucket_name - region = local.bootstrap_config.region - } - - mock_outputs_allowed_terraform_commands = ["plan", "validate"] -} - -dependency "lock" { - config_path = "../lock" - - mock_outputs = { - dynamodb_table_name = local.bootstrap_config.state.dynamodb_table_name - region = local.bootstrap_config.region - } - - mock_outputs_allowed_terraform_commands = ["plan", "validate"] +dependencies { + paths = ["../state", "../lock"] } terraform { - source = "./" -} - -inputs = { - region = dependency.state.outputs.region - state_bucket_name = dependency.state.outputs.bucket_name - state_lock_table_name = dependency.lock.outputs.dynamodb_table_name - bootstrap = local.bootstrap_config - account = local.account_config + source = "${get_parent_terragrunt_dir()}/..//bootstrap/identity" } diff --git a/iac-template/terraform-hcl-standard/aws-cloud/bootstrap/identity/variables.tf b/iac-template/terraform-hcl-standard/aws-cloud/bootstrap/identity/variables.tf index 549afd82..bcfc31ba 100644 --- a/iac-template/terraform-hcl-standard/aws-cloud/bootstrap/identity/variables.tf +++ b/iac-template/terraform-hcl-standard/aws-cloud/bootstrap/identity/variables.tf @@ -73,15 +73,3 @@ variable "state_lock_table_name" { type = string default = null } - -variable "bootstrap" { - description = "Bootstrap configuration provided by Terragrunt" - type = map(any) - default = {} -} - -variable "account" { - description = "Resolved account configuration provided by Terragrunt" - type = map(any) - default = {} -} diff --git a/iac-template/terraform-hcl-standard/aws-cloud/bootstrap/lock/locals.tf b/iac-template/terraform-hcl-standard/aws-cloud/bootstrap/lock/locals.tf index cd71a14a..ec47840d 100644 --- a/iac-template/terraform-hcl-standard/aws-cloud/bootstrap/lock/locals.tf +++ b/iac-template/terraform-hcl-standard/aws-cloud/bootstrap/lock/locals.tf @@ -1,5 +1,5 @@ locals { - bootstrap = var.bootstrap + bootstrap = yamldecode(file("${path.module}/../../config/accounts/bootstrap.yaml")) dynamodb_table_name = coalesce(var.table_name, local.bootstrap.state.dynamodb_table_name) region = coalesce(var.region, local.bootstrap.region) diff --git a/iac-template/terraform-hcl-standard/aws-cloud/bootstrap/lock/terragrunt.hcl b/iac-template/terraform-hcl-standard/aws-cloud/bootstrap/lock/terragrunt.hcl index ce4c3c9a..7553a16d 100644 --- a/iac-template/terraform-hcl-standard/aws-cloud/bootstrap/lock/terragrunt.hcl +++ b/iac-template/terraform-hcl-standard/aws-cloud/bootstrap/lock/terragrunt.hcl @@ -2,27 +2,10 @@ include "root" { path = find_in_parent_folders() } -locals { - root_config = read_terragrunt_config(find_in_parent_folders()) - bootstrap_config = local.root_config.locals.bootstrap_config -} - -dependency "state" { - config_path = "../state" - - mock_outputs = { - bucket_name = local.bootstrap_config.state.bucket_name - region = local.bootstrap_config.region - } - - mock_outputs_allowed_terraform_commands = ["plan", "validate"] +dependencies { + paths = ["../state"] } terraform { - source = "./" -} - -inputs = { - region = dependency.state.outputs.region - bootstrap = local.bootstrap_config + source = "${get_parent_terragrunt_dir()}/..//bootstrap/lock" } diff --git a/iac-template/terraform-hcl-standard/aws-cloud/bootstrap/lock/variables.tf b/iac-template/terraform-hcl-standard/aws-cloud/bootstrap/lock/variables.tf index 8474ce27..a2efe3b3 100644 --- a/iac-template/terraform-hcl-standard/aws-cloud/bootstrap/lock/variables.tf +++ b/iac-template/terraform-hcl-standard/aws-cloud/bootstrap/lock/variables.tf @@ -9,9 +9,3 @@ variable "region" { type = string default = null } - -variable "bootstrap" { - description = "Bootstrap configuration provided by Terragrunt" - type = map(any) - default = {} -} diff --git a/iac-template/terraform-hcl-standard/aws-cloud/bootstrap/state/locals.tf b/iac-template/terraform-hcl-standard/aws-cloud/bootstrap/state/locals.tf index 64a1c3d7..f8412c24 100644 --- a/iac-template/terraform-hcl-standard/aws-cloud/bootstrap/state/locals.tf +++ b/iac-template/terraform-hcl-standard/aws-cloud/bootstrap/state/locals.tf @@ -1,5 +1,5 @@ locals { - bootstrap = var.bootstrap + bootstrap = yamldecode(file("${path.module}/../../config/accounts/bootstrap.yaml")) bucket_name = coalesce(var.bucket_name, local.bootstrap.state.bucket_name) region = coalesce(var.region, local.bootstrap.region) diff --git a/iac-template/terraform-hcl-standard/aws-cloud/bootstrap/state/terragrunt.hcl b/iac-template/terraform-hcl-standard/aws-cloud/bootstrap/state/terragrunt.hcl index 1d1be78e..665b913b 100644 --- a/iac-template/terraform-hcl-standard/aws-cloud/bootstrap/state/terragrunt.hcl +++ b/iac-template/terraform-hcl-standard/aws-cloud/bootstrap/state/terragrunt.hcl @@ -2,17 +2,6 @@ include "root" { path = find_in_parent_folders() } -locals { - root_config = read_terragrunt_config(find_in_parent_folders()) - bootstrap_config = local.root_config.locals.bootstrap_config -} - terraform { - source = "./" -} - -inputs = { - bucket_name = local.bootstrap_config.state.bucket_name - region = local.bootstrap_config.region - bootstrap = local.bootstrap_config + source = "${get_parent_terragrunt_dir()}/..//bootstrap/state" } diff --git a/iac-template/terraform-hcl-standard/aws-cloud/bootstrap/state/variables.tf b/iac-template/terraform-hcl-standard/aws-cloud/bootstrap/state/variables.tf index f51ac18f..e08efbea 100644 --- a/iac-template/terraform-hcl-standard/aws-cloud/bootstrap/state/variables.tf +++ b/iac-template/terraform-hcl-standard/aws-cloud/bootstrap/state/variables.tf @@ -9,9 +9,3 @@ variable "region" { type = string default = null } - -variable "bootstrap" { - description = "Bootstrap configuration provided by Terragrunt" - type = map(any) - default = {} -} diff --git a/iac-template/terraform-hcl-standard/aws-cloud/bootstrap/terragrunt.hcl b/iac-template/terraform-hcl-standard/aws-cloud/bootstrap/terragrunt.hcl index 49335045..c2366d8f 100644 --- a/iac-template/terraform-hcl-standard/aws-cloud/bootstrap/terragrunt.hcl +++ b/iac-template/terraform-hcl-standard/aws-cloud/bootstrap/terragrunt.hcl @@ -2,5 +2,5 @@ terraform_version_constraint = ">= 1.2.0" terragrunt_version_constraint = ">= 0.67.14" locals { - bootstrap_config = yamldecode(file(find_in_parent_folders("config/accounts/bootstrap.yaml"))) + bootstrap_config = yamldecode(file("${get_original_terragrunt_dir()}/../config/accounts/bootstrap.yaml")) } From b2eb1a8f0855471b8d6284342e001561d2e3950f Mon Sep 17 00:00:00 2001 From: cloudneutral Date: Thu, 11 Dec 2025 00:45:25 +0800 Subject: [PATCH 6/6] Ensure bootstrap modules load config directly --- .../aws-cloud/bootstrap/identity/locals.tf | 2 +- .../aws-cloud/bootstrap/identity/terragrunt.hcl | 4 ++++ .../aws-cloud/bootstrap/identity/variables.tf | 6 ++++++ .../aws-cloud/bootstrap/lock/locals.tf | 2 +- .../aws-cloud/bootstrap/lock/terragrunt.hcl | 4 ++++ .../aws-cloud/bootstrap/lock/variables.tf | 6 ++++++ .../aws-cloud/bootstrap/state/locals.tf | 2 +- .../aws-cloud/bootstrap/state/terragrunt.hcl | 4 ++++ .../aws-cloud/bootstrap/state/variables.tf | 6 ++++++ .../aws-cloud/bootstrap/terragrunt.hcl | 3 --- 10 files changed, 33 insertions(+), 6 deletions(-) diff --git a/iac-template/terraform-hcl-standard/aws-cloud/bootstrap/identity/locals.tf b/iac-template/terraform-hcl-standard/aws-cloud/bootstrap/identity/locals.tf index a9f1bf25..8ef9f702 100644 --- a/iac-template/terraform-hcl-standard/aws-cloud/bootstrap/identity/locals.tf +++ b/iac-template/terraform-hcl-standard/aws-cloud/bootstrap/identity/locals.tf @@ -1,5 +1,5 @@ locals { - bootstrap = yamldecode(file("${path.module}/../../config/accounts/bootstrap.yaml")) + bootstrap = yamldecode(file(abspath(var.bootstrap_config_path))) config_account_name = coalesce(var.account_name, local.bootstrap.account_name) config_region = coalesce(var.region, local.bootstrap.region) diff --git a/iac-template/terraform-hcl-standard/aws-cloud/bootstrap/identity/terragrunt.hcl b/iac-template/terraform-hcl-standard/aws-cloud/bootstrap/identity/terragrunt.hcl index 22a292a6..e03a560a 100644 --- a/iac-template/terraform-hcl-standard/aws-cloud/bootstrap/identity/terragrunt.hcl +++ b/iac-template/terraform-hcl-standard/aws-cloud/bootstrap/identity/terragrunt.hcl @@ -9,3 +9,7 @@ dependencies { terraform { source = "${get_parent_terragrunt_dir()}/..//bootstrap/identity" } + +inputs = { + bootstrap_config_path = abspath("${get_parent_terragrunt_dir()}/../config/accounts/bootstrap.yaml") +} diff --git a/iac-template/terraform-hcl-standard/aws-cloud/bootstrap/identity/variables.tf b/iac-template/terraform-hcl-standard/aws-cloud/bootstrap/identity/variables.tf index bcfc31ba..b69810f1 100644 --- a/iac-template/terraform-hcl-standard/aws-cloud/bootstrap/identity/variables.tf +++ b/iac-template/terraform-hcl-standard/aws-cloud/bootstrap/identity/variables.tf @@ -73,3 +73,9 @@ variable "state_lock_table_name" { type = string default = null } + +variable "bootstrap_config_path" { + description = "Path to the bootstrap account configuration YAML" + type = string + default = "../../config/accounts/bootstrap.yaml" +} diff --git a/iac-template/terraform-hcl-standard/aws-cloud/bootstrap/lock/locals.tf b/iac-template/terraform-hcl-standard/aws-cloud/bootstrap/lock/locals.tf index ec47840d..b44eff3e 100644 --- a/iac-template/terraform-hcl-standard/aws-cloud/bootstrap/lock/locals.tf +++ b/iac-template/terraform-hcl-standard/aws-cloud/bootstrap/lock/locals.tf @@ -1,5 +1,5 @@ locals { - bootstrap = yamldecode(file("${path.module}/../../config/accounts/bootstrap.yaml")) + bootstrap = yamldecode(file(abspath(var.bootstrap_config_path))) dynamodb_table_name = coalesce(var.table_name, local.bootstrap.state.dynamodb_table_name) region = coalesce(var.region, local.bootstrap.region) diff --git a/iac-template/terraform-hcl-standard/aws-cloud/bootstrap/lock/terragrunt.hcl b/iac-template/terraform-hcl-standard/aws-cloud/bootstrap/lock/terragrunt.hcl index 7553a16d..2ad34644 100644 --- a/iac-template/terraform-hcl-standard/aws-cloud/bootstrap/lock/terragrunt.hcl +++ b/iac-template/terraform-hcl-standard/aws-cloud/bootstrap/lock/terragrunt.hcl @@ -9,3 +9,7 @@ dependencies { terraform { source = "${get_parent_terragrunt_dir()}/..//bootstrap/lock" } + +inputs = { + bootstrap_config_path = abspath("${get_parent_terragrunt_dir()}/../config/accounts/bootstrap.yaml") +} diff --git a/iac-template/terraform-hcl-standard/aws-cloud/bootstrap/lock/variables.tf b/iac-template/terraform-hcl-standard/aws-cloud/bootstrap/lock/variables.tf index a2efe3b3..e48decec 100644 --- a/iac-template/terraform-hcl-standard/aws-cloud/bootstrap/lock/variables.tf +++ b/iac-template/terraform-hcl-standard/aws-cloud/bootstrap/lock/variables.tf @@ -9,3 +9,9 @@ variable "region" { type = string default = null } + +variable "bootstrap_config_path" { + description = "Path to the bootstrap account configuration YAML" + type = string + default = "../../config/accounts/bootstrap.yaml" +} diff --git a/iac-template/terraform-hcl-standard/aws-cloud/bootstrap/state/locals.tf b/iac-template/terraform-hcl-standard/aws-cloud/bootstrap/state/locals.tf index f8412c24..eeeff1c0 100644 --- a/iac-template/terraform-hcl-standard/aws-cloud/bootstrap/state/locals.tf +++ b/iac-template/terraform-hcl-standard/aws-cloud/bootstrap/state/locals.tf @@ -1,5 +1,5 @@ locals { - bootstrap = yamldecode(file("${path.module}/../../config/accounts/bootstrap.yaml")) + bootstrap = yamldecode(file(abspath(var.bootstrap_config_path))) bucket_name = coalesce(var.bucket_name, local.bootstrap.state.bucket_name) region = coalesce(var.region, local.bootstrap.region) diff --git a/iac-template/terraform-hcl-standard/aws-cloud/bootstrap/state/terragrunt.hcl b/iac-template/terraform-hcl-standard/aws-cloud/bootstrap/state/terragrunt.hcl index 665b913b..f0eb7e4e 100644 --- a/iac-template/terraform-hcl-standard/aws-cloud/bootstrap/state/terragrunt.hcl +++ b/iac-template/terraform-hcl-standard/aws-cloud/bootstrap/state/terragrunt.hcl @@ -5,3 +5,7 @@ include "root" { terraform { source = "${get_parent_terragrunt_dir()}/..//bootstrap/state" } + +inputs = { + bootstrap_config_path = abspath("${get_parent_terragrunt_dir()}/../config/accounts/bootstrap.yaml") +} diff --git a/iac-template/terraform-hcl-standard/aws-cloud/bootstrap/state/variables.tf b/iac-template/terraform-hcl-standard/aws-cloud/bootstrap/state/variables.tf index e08efbea..c2041b5a 100644 --- a/iac-template/terraform-hcl-standard/aws-cloud/bootstrap/state/variables.tf +++ b/iac-template/terraform-hcl-standard/aws-cloud/bootstrap/state/variables.tf @@ -9,3 +9,9 @@ variable "region" { type = string default = null } + +variable "bootstrap_config_path" { + description = "Path to the bootstrap account configuration YAML" + type = string + default = "../../config/accounts/bootstrap.yaml" +} diff --git a/iac-template/terraform-hcl-standard/aws-cloud/bootstrap/terragrunt.hcl b/iac-template/terraform-hcl-standard/aws-cloud/bootstrap/terragrunt.hcl index c2366d8f..c95d6006 100644 --- a/iac-template/terraform-hcl-standard/aws-cloud/bootstrap/terragrunt.hcl +++ b/iac-template/terraform-hcl-standard/aws-cloud/bootstrap/terragrunt.hcl @@ -1,6 +1,3 @@ terraform_version_constraint = ">= 1.2.0" terragrunt_version_constraint = ">= 0.67.14" -locals { - bootstrap_config = yamldecode(file("${get_original_terragrunt_dir()}/../config/accounts/bootstrap.yaml")) -}