Support of deprecation warnings for parameters with unknown values in terraform validate
#845
Labels
enhancement
New feature or request
terraform validate
#845
Module version
Use-cases
Detect and alert programmatically on use of deprecated provider parameters in HCL code stored in Github/Gitlab using CI actions.
HCL code may drift over time as
>=
or~>
notation is used in the provider/module version constraints. The action would alert to the use of a deprecated provider parameter if a provider version is upgradedAttempted Solutions
terraform validate --json
- Cannot be used as deprecated parameters in the configuration HCL with unknown values (values determined afterterraform apply
) are not returned as warnings. E.g., a value that comes from a data source, used as a reference to a deprecated parameter on a resource will not show as a warning hereterraform plan
- Same as above, unless previously applied.terraform apply
- Warnings are aggregated and limited and there doesn't appear to be a way to extract them as a full list in JSON. Also, infrastructure shouldn't need to be provisioned to warn about the use of deprecated attributes in the HCL.Note that because of the above, the warnings returned by
terraform validate
are a subset of warnings returned fromterraform apply
Proposal
Without knowing details of the Terraform architecture, the ideal situation would be for
terraform validate --json
to return use of deprecated attributes declared in the HCL, even if the values are unknownReferences
terraform validate
terraform#33939The text was updated successfully, but these errors were encountered: