Fix bootstrap IAM defaults

This commit is contained in:
cloudneutral 2025-12-08 17:41:03 +08:00
parent 826e3d2ef1
commit e77d4621fd
2 changed files with 7 additions and 4 deletions

View File

@ -1,7 +1,7 @@
account_name ?=
region ?=
role_name ?=
terraform_user_name ?=
terraform_user_name ?=
TF_VARS := $(if $(account_name),-var="account_name=$(account_name)") $(if $(region),-var="region=$(region)") $(if $(role_name),-var="role_name=$(role_name)") $(if $(terraform_user_name),-var="terraform_user_name=$(terraform_user_name)")

View File

@ -10,7 +10,10 @@ locals {
}
locals {
account = yamldecode(
file("${path.root}/../config/accounts/${local.config_account_name}.yaml")
)
account_file_path = "${path.root}/../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
}
}