It appears that Terraform is generating invalid plan files when -out= is used.
0.9.1
Core Terraform.
Expected to see terraform apply file.out apply any pending changes generated by terraform plan -out=file.out
Failed to load backend: The plan file contained both a legacy remote state and backend configuration.
This is not allowed. Please recreate the plan file with the latest version of
Terraform.
Please list the steps required to reproduce the issue, for example:
rm file.out (just in case it exists currently)terraform plan -out=file.outterraform plan file.outI'm applying changes using -target= statements.
Yeah I am seeing this too after the upgrade.
I found the issue. The migration code doesn't clear the remote section remotely (it clears it locally in what is called the "data" state which only has the backend configuration). I will fix this early in the AM tomorrow.
Same thing happens with an Atlas backend, version 0.9.1
Yes this is a generic problem with any legacy remote state. Plan on working on a fix here shortly.
Fix in attached PR, will be part of 0.9.2.
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.
Most helpful comment
I found the issue. The migration code doesn't clear the remote section remotely (it clears it locally in what is called the "data" state which only has the backend configuration). I will fix this early in the AM tomorrow.