Describe the enhancement
Add a way to set a project-wide default value for mock_outputs_allowed_terraform_commands so it does not need to be repeated on every dependency block.
Today, every dependency block that uses mock_outputs must also explicitly declare which commands are allowed to use those mocks. In a large repo this setting is almost always identical across every unit, resulting in significant boilerplate that is easy to forget and tedious to keep consistent.
dependency "vpc" {
config_path = "../vpc"
mock_outputs_allowed_terraform_commands = ["plan", "validate"]
mock_outputs = { vpc_id = "mock-vpc-id" }
}
Additional context
Implementation suggestion: A dependency_defaults (I'm not married to the name) block in the root HCL file that is merged into every dependency block. Individual blocks can still override the default.
# root.hcl
dependency_defaults {
mock_outputs_allowed_terraform_commands = ["plan", "validate"]
}
Implications of the feature: The per-block mock_outputs_allowed_terraform_commands value can take precedence, therefore this would be a non-breaking change.
Alternatives considered:
- Without any changes to terragrunt, use
read_terragrunt_config to pull in a shared snippet. This solves the consistency part, but it still requires each dependency block to reference it.
- Similarly, expose the
root.hcl locals in which you've defined e.g. mock_outputs = ["plan", "validate"].
- CLI argument / environment variable that disables mock outputs, e.g.
terragrunt apply --all --no-mock-outputs.
PoC (Proof of Concept)
No
RFC Not Needed
Describe the enhancement
Add a way to set a project-wide default value for
mock_outputs_allowed_terraform_commandsso it does not need to be repeated on everydependencyblock.Today, every dependency block that uses
mock_outputsmust also explicitly declare which commands are allowed to use those mocks. In a large repo this setting is almost always identical across every unit, resulting in significant boilerplate that is easy to forget and tedious to keep consistent.Additional context
Implementation suggestion: A
dependency_defaults(I'm not married to the name) block in the root HCL file that is merged into every dependency block. Individual blocks can still override the default.Implications of the feature: The per-block
mock_outputs_allowed_terraform_commandsvalue can take precedence, therefore this would be a non-breaking change.Alternatives considered:
read_terragrunt_configto pull in a shared snippet. This solves the consistency part, but it still requires each dependency block to reference it.root.hcllocals in which you've defined e.g.mock_outputs = ["plan", "validate"].terragrunt apply --all --no-mock-outputs.PoC (Proof of Concept)
No
RFC Not Needed