Ensure bootstrap modules load config directly

This commit is contained in:
cloudneutral 2025-12-11 00:45:25 +08:00
parent a4db6e2e13
commit b2eb1a8f08
10 changed files with 33 additions and 6 deletions

View File

@ -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)

View File

@ -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")
}

View File

@ -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"
}

View File

@ -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)

View File

@ -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")
}

View File

@ -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"
}

View File

@ -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)

View File

@ -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")
}

View File

@ -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"
}

View File

@ -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"))
}