Skip to content

Terraform v1.10.0 breaks apply --auto-approve when using list/dict variables #36106

@pvieito

Description

@pvieito

Terraform Version

$ terraform apply -auto-approve
aws_s3_bucket.sf_admin_swamp[0]: Refreshing state... [id=swamp-sf-admin-test]
aws_s3_bucket.model: Refreshing state... [id=shopfully-data-model-lab]

No changes. Your infrastructure matches the configuration.

Terraform has compared your real infrastructure against your configuration
and found no differences, so no changes are needed.
╷
│ Error: Can't change variable when applying a saved plan

│ The variable provider_aws_default_tags__default cannot be set using the
│ -var and -var-file options when applying a saved plan file, because a saved
│ plan includes the variable values that were set when it was created. The
│ saved plan specifies "{\"Environment\": \"LAB\", \"ProjectName\":
│ \"DataModel\", \"DeploymentName\": \"DataModel-Infrastructure-Model\",
│ \"CostCenter\": \"Engineering\", \"BusinessLine\": \"DataModel\", \"Role\":
│ \"DataModel\", \"ProductLine\": \"DataModel-Infrastructure-Model\",
│ \"Product\": \"DataModel-Infrastructure-Model\", \"Module\":
│ \"DataModel-Infrastructure-Model\", \"Stack\":
│ \"DataModel-Infrastructure-Model\", \"InfrastructureToolName\":
│ \"infrastructure\", \"InfrastructureGroup\": \"Model\",
│ \"InfrastructureDeploymentService\": \"terraform\"}" as the value whereas
│ during apply the value object with 13 attributes was set by an environment
│ variable. To declare an ephemeral variable which is not saved in the plan
│ file, use ephemeral = true.

Terraform Configuration Files

Debug Output

Expected Behavior

This should not fail.

Actual Behavior

Fails even though we are not using a saved plan!

Steps to Reproduce

  1. Use terraform list/dict variables
  2. Set them with env-vars
  3. terraform apply --auto-approve
  4. Fails

Additional Context

No response

References

No response

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions