-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Description
Describe the enhancement
terragrunt stack output
provides a nice and hierarchical way to display outputs for explicit stacks (with a terragrunt.stack.hcl
). It would be awesome if a similar output could be provided for implicit stacks (without terragrunt.stack.hcl
)
As there is no explicit name definition for the units, the relative path of its folder shall be used as the key instead.
Additional context
The current alternative terragrunt output --all
does not maintain the same hierarchical view and outputs cannot be tied to their individual unit. Outputs could also potentialy even overlap if 2 units declare one with the same name.
I am not sure how this should materialize itself: could be with the introduction on a new switch on either terragrunt stack
or terragrunt output
The effort should be reasonable, as most of the logic is already implemented for explicit stacks.
PoC (Proof of Concept)
$ terragrunt output --all --stack/hierarchical
./backend_app = {
domain = "backend-app.example.com"
}
./somefolder/frontend/anotherfolder = {
domain = "frontend-app.example.com"
}
./mysql = {
endpoint = "terraform-20250504140737772400000001.abcdefghijkl.us-east-1.rds.amazonaws.com"
}
./somefolder/aws = {
endpoint = "serverless-valkey-01.amazonaws.com"
}
./vpc = {
vpc_id = "vpc-1234567890"
}