🧪 Experiments Updated
The filter-flag experiment now supports --filter in stack generate
The --filter flag can now be used in the stack generate command, and any command that performs stack generation, e.g. run --all (remember that you must use the filter-flag experiment to try this).
The --filter flag works in a slightly unique way when used to control stack generation in that it needs to be explicitly restricted to stacks for it to impact stack generation using the type=stack attribute filter.
e.g.
# Supported: Only generate the stacks that match the filter, as we are explicitly indicating that we are targeting stacks.
terragrunt stack generate --filter 'name=prod | type=stack'
# Not supported: This filter will be ignored, as we are not explicitly indicating that we are targeting stacks.
terragrunt stack generate --filter 'name=prod' # This will not workThe reason for this is that stack generation can also be done automatically as part of other commands, like run, and thus we need to make it clear that we’re trying to control stack generation rather than run behavior.
# This will run any unit named 'vpc'
terragrunt run --all --filter 'vpc' -- plan
# This will run any unit named 'vpc', and prevent stack generation in any stack not named 'dev' (including any stacks named 'vpc')
terragrunt stack run --filter 'vpc' --filter 'name=dev | type=stack' -- applyFor more information, see the filter feature documentation
What's Changed
- feat: Adding support for
-filterinstack generateby @yhakbar in #5073 - docs: Documenting
-filterforstack generateby @yhakbar in #5084
Full Changelog: v0.93.4...v0.93.5