Orion7X
03/06/2026, 4:10 PMmt-prod-us, lt-prod-us-customer1)
- Each top-level stack only needs two things: 1) an import for its deployment type, and 2) deployment-specific vars
- Blueprints are composable - a blueprint imports layers, layers import components
Example top-level stack:
yaml
# stacks/mt/prod-us.yml
name: mt-prod-us
import:
- catalog/blueprints/mt
vars:
stage: prod
region: us-east-1
cidr_block: "1.1.1.0/24"
rds_instance_type: "db.r5.12xlarge"
Blueprint stack:
yaml
# catalog/blueprints/mt.yml
import:
- catalog/layers/aws/networking
- catalog/layers/aws/compute
- catalog/layers/aws/storage
Each Layer would import some number of Components, such as vpc, subnets, etc. for the networking layer.
This looks similar to the Layered Stack Configuration pattern in the docs. My main question is around var precedence: how do I set a default (e.g. cidr_block: 192.168.0.0/24) in a blueprint/layer/component, but allow a top-level stack to override it?
Two options I see:
1. Drop the blueprint layer and list all layer imports directly in each top-level stack - but this risks drift between deployments over time, so probably a no-go for us
2. Use overrides.vars in the top-level stack instead of vars - seems to work in testing, but not sure if this is an anti-pattern
Is option 2 the right approach here, or is there a better pattern for this? Thanks! 🙏Erik Osterman (Cloud Posse)
03/06/2026, 5:29 PMErik Osterman (Cloud Posse)
03/06/2026, 5:29 PMErik Osterman (Cloud Posse)
03/06/2026, 5:29 PMErik Osterman (Cloud Posse)
03/06/2026, 5:29 PMErik Osterman (Cloud Posse)
03/06/2026, 5:38 PMMy main question is around var precedence: how do I set a default (e.g.) in a blueprint/layer/component, but allow a top-level stack to override it?cidr_block: 192.168.0.0/24
Erik Osterman (Cloud Posse)
03/06/2026, 5:38 PMErik Osterman (Cloud Posse)
03/06/2026, 5:38 PMErik Osterman (Cloud Posse)
03/06/2026, 5:41 PM# stacks/mt/prod-us.yml (this file)
import:
- something1.yaml # your defaults
- something2.yaml # this overrides something1 (deep merges on top of it)
# here's where you override anything you want after processing imports
components:
terraform:
vpc:
vars:
cidr_block: 192.168.0.0/24 # this has highest presedenceErik Osterman (Cloud Posse)
03/06/2026, 5:45 PMOrion7X
03/06/2026, 6:57 PMcidr_block in vars.cidr_block, but in the nested vpc defaults.yaml, I set cidr_block in components.terraform.vpc.vars.cidr_block, so the nested defaults were overriding my settings in the top-level stack file. After I put cidr_block in the component vars in the top-level file, the right value was applied.
More specifically...
What I was doing that wasn't working resulted in:
❯ atmos describe component vpc -s mt-prod-us | yq .sources.vars.cidr_block
final_value: 192.168.55.0/24
name: cidr_block
stack_dependencies:
- dependency_type: import
stack_file: catalog/components/aws/vpc/defaults
stack_file_section: components.terraform.vars
variable_value: 192.168.55.0/24
- dependency_type: inline
stack_file: deploy/mt/prod-us
stack_file_section: vars
variable_value: 1.1.1.0/24
After correcting my mistage:
❯ atmos describe component vpc -s mt-prod-us | yq .sources.vars.cidr_block
final_value: 1.1.1.0/24
name: cidr_block
stack_dependencies:
- dependency_type: inline
stack_file: deploy/mt/prod-us
stack_file_section: components.terraform.vars
variable_value: 1.1.1.0/24
- dependency_type: import
stack_file: catalog/components/aws/vpc/defaults
stack_file_section: components.terraform.vars
variable_value: 192.168.55.0/24Andriy Knysh (Cloud Posse)
03/06/2026, 8:29 PMOrion7X
03/09/2026, 3:43 PMOrion7X
03/09/2026, 8:53 PMdepends_on with the Github Actions workflow doesn't have any effect? If so, is there any sort of workaround? ThanksErik Osterman (Cloud Posse)
03/09/2026, 8:55 PMErik Osterman (Cloud Posse)
03/09/2026, 8:55 PMErik Osterman (Cloud Posse)
03/09/2026, 8:55 PMErik Osterman (Cloud Posse)
03/09/2026, 8:56 PMErik Osterman (Cloud Posse)
03/09/2026, 8:56 PMOrion7X
03/09/2026, 8:59 PM