Replies: 1 comment
-
|
Hey @hossko , This is a little hard to follow. Do you mind supplying some configurations that the community can fully copy + paste into their local workstations and some instructions on how to get the behavior you're looking for? As a tip: If you use the ` character three times (```) with an ```hcl Becomes: locals {
foo = "bar"
} |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hello,
I am trying to create a nested stacks with regional configuration,
here is my root dir:
.
├── config
│ ├── global.config.hcl
│ ├── us-central1.config.hcl
│ └── us-east1.config.hcl
├── root.hcl
├── terragrunt.stack.hcl
└── us-central1
└── terragrunt.stack.hcl
my root stack config:
#########################
locals {
Load all environment-specific configuration files
global_vars = read_terragrunt_config("config/global.config.hcl").locals
us_central1_vars = read_terragrunt_config("config/us-central1.config.hcl").locals
us_east1_vars = read_terragrunt_config("config/us-east1.config.hcl").locals
}
Global IAM Configuration
unit "iam" {
source = "${get_repo_root()}//units/iam"
path = "iam"
values = {
env = local.global_vars
}
}
US Central 1 Stack
stack "us-central1" {
source = "./us-central1"
path = "us-central1"
values = {
env = merge(local.global_vars, local.us_central1_vars)
}
}
##############################################
But when i execute "terragrunt stack generate", it create the us-central1 rendered config in 2 directories
.
├── config
│ ├── global.config.hcl
│ ├── us-central1.config.hcl
│ └── us-east1.config.hcl
├── root.hcl
├── terragrunt.stack.hcl
└── us-central1
└── terragrunt.stack.hcl
2 directories, 6 files
❯ tree -a -L 3
.
├── .terragrunt-stack
│ ├── iam
│ │ ├── .terragrunt-stack-manifest
│ │ ├── terragrunt.hcl
│ │ └── terragrunt.values.hcl
│ └── us-central1
│ ├── .terragrunt-stack
│ ├── .terragrunt-stack-manifest
│ ├── terragrunt.stack.hcl
│ └── terragrunt.values.hcl
├── config
│ ├── global.config.hcl
│ ├── us-central1.config.hcl
│ └── us-east1.config.hcl
├── root.hcl
├── terragrunt.stack.hcl
└── us-central1
├── .terragrunt-stack
│ └── networking
└── terragrunt.stack.hcl
Seems it is autodiscovering the us-central1 stack and treating it as a standalone, thus breaking input values and dependency path.
Any help please
Beta Was this translation helpful? Give feedback.
All reactions