Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Terraform 1.10 - Error: Can't change variable when applying a saved plan #36130

Closed
pauldtill opened this issue Nov 28, 2024 · 2 comments
Closed
Labels
bug duplicate issue closed because another issue already tracks this problem

Comments

@pauldtill
Copy link

Terraform Version

Terraform v1.10.0

Terraform Configuration Files

variable "this_is_a_list_variable" {
  type    = list(string)
  default = []
}

Debug Output

https://gist.github.com/pauldtill/693a77980b7409e91d8c506eecb23085

Expected Behavior

Terraform apply is successful.

Actual Behavior

Terraform plan works OK - terraform apply fails with -

│ Error: Can't change variable when applying a saved plan

Steps to Reproduce

export TF_VAR_this_is_a_list_variable='["stuff"]'
terraform plan -input=false -out=plan.tfplan
terraform apply plan.tfplan

Additional Context

This seems to be an issue with the way a TF_VAR list environment variable is stored in the plan compared to how it is seen at runtime for apply - confirmed this does not occur at v1.9.8 with the same basic config / environment variable.

References

No response

@pauldtill pauldtill added bug new new issue not yet triaged labels Nov 28, 2024
@radeksimko
Copy link
Member

Hi @pauldtill
Thank you for the report. I believe this is the same issue as reported in #36106

It will be fixed as part of #36121 - I ran the attached config/steps through and can confirm the PR fixes it.

@radeksimko radeksimko closed this as not planned Won't fix, can't repro, duplicate, stale Nov 28, 2024
@crw crw added duplicate issue closed because another issue already tracks this problem and removed new new issue not yet triaged labels Dec 2, 2024
Copy link
Contributor

github-actions bot commented Jan 2, 2025

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.
If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jan 2, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug duplicate issue closed because another issue already tracks this problem
Projects
None yet
Development

No branches or pull requests

3 participants