Terraform Version
terraform version
Terraform v0.12.6
Terraform Configuration Files
main.tf
provider "null" {
}
resource "null_resource" "res" {
}
main.tfvars
Run
terraform init && terraform plan -var-file=main.tfvars
Expected Behavior
Warnings should be shown even if there are no changes.
Actual Behavior
Warnings are shown only when there are changes.
Steps to Reproduce
terraform init
terraform plan -var-file=main.tfvars
Changes and warnings are shown
terraform apply -var-file=main.tfvars -auto-approve
terraform plan -var-file=main.tfvars
No changes, no warnings
Additional Context
After migration to terraform 0.12 we saw stricter behavior and warnings we would like to address, but we see them only when there are changes. So we have to create a change artificially in order to fix those recommendations.
Example of the warning:
Warning: Value for undeclared variable
on main.tfvars line 1:
1: test_var="12345"
The root module does not declare a variable named "test_var". To use this
value, add a "variable" block to the configuration.
Using a variables file to set an undeclared variable is deprecated and will
become an error in a future release. If you wish to provide certain "global"
settings to all configurations in your organization, use TF_VAR_...
environment variables to set these instead.
Terraform Version
Terraform Configuration Files
main.tf
main.tfvars
Run
terraform init && terraform plan -var-file=main.tfvarsExpected Behavior
Warnings should be shown even if there are no changes.
Actual Behavior
Warnings are shown only when there are changes.
Steps to Reproduce
terraform initterraform plan -var-file=main.tfvarsChanges and warnings are shown
terraform apply -var-file=main.tfvars -auto-approveterraform plan -var-file=main.tfvarsNo changes, no warnings
Additional Context
After migration to terraform 0.12 we saw stricter behavior and warnings we would like to address, but we see them only when there are changes. So we have to create a change artificially in order to fix those recommendations.
Example of the warning: