Stack-Wide Metadata Defaults: Set Labels and Tags Once
· 3 min read
Most components in a stack share the same cost center label or the same compliance-scope tag. vars, env, and settings can all be declared once at the stack level and inherited by every component. metadata couldn't — every component had to repeat the same labels/tags, and a metadata: block placed at the top of a stack file was silently ignored.
Stack manifests can now declare stack-wide metadata defaults that every component inherits, with the component's own metadata: still free to override them.
The Problem
- Shared metadata meant duplicated metadata. If every component in a stack carries the same
cost-centerlabel or the same compliance tag, that block had to be copy-pasted into every component definition, and kept in sync by hand as components were added. - A stack-level
metadata:block looked like it should work, and didn't. Unlikevars/env/settings, ametadata:key at the root of a stack manifest was accepted but never applied — it silently did nothing, which is worse than a validation error.
