Merge pull request #204 from cloud-neutral-workshop/codex/fix-invalid-file-path-in-locals.tf

Simplify bootstrap config path input
This commit is contained in:
cloudneutral 2025-12-24 13:30:11 +08:00 committed by GitHub
commit acc12df087
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 6 additions and 6 deletions

View File

@ -1,9 +1,5 @@
locals { locals {
config_root = coalesce(var.config_root, abspath("${path.module}/../../../../../gitops")) bootstrap_config_path = abspath(var.bootstrap_config_path)
bootstrap_config_path = coalesce(
var.bootstrap_config_path,
"${local.config_root}/config/accounts/bootstrap.yaml"
)
bootstrap = yamldecode(file(local.bootstrap_config_path)) bootstrap = yamldecode(file(local.bootstrap_config_path))

View File

@ -13,7 +13,11 @@ variable "region" {
variable "bootstrap_config_path" { variable "bootstrap_config_path" {
description = "Path to the bootstrap account configuration YAML" description = "Path to the bootstrap account configuration YAML"
type = string type = string
default = null
validation {
condition = var.bootstrap_config_path != null && trim(var.bootstrap_config_path) != ""
error_message = "Set bootstrap_config_path to the GitHub Action environment input that points to the bootstrap YAML file."
}
} }
variable "config_root" { variable "config_root" {