Terraform: Terraform 0.9.1 can't apply plan from a file with S3 backend

Created on 19 Mar 2017  ยท  6Comments  ยท  Source: hashicorp/terraform

It appears that Terraform is generating invalid plan files when -out= is used.

Terraform Version

0.9.1

Affected Resource(s)

Core Terraform.

Expected Behavior

Expected to see terraform apply file.out apply any pending changes generated by terraform plan -out=file.out

Actual Behavior

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.

Steps to Reproduce

Please list the steps required to reproduce the issue, for example:

  1. rm file.out (just in case it exists currently)
  2. terraform plan -out=file.out
  3. terraform plan file.out

Current Mitigation

I'm applying changes using -target= statements.

bug core

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.

All 6 comments

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.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ketzacoatl picture ketzacoatl  ยท  3Comments

ronnix picture ronnix  ยท  3Comments

rnowosielski picture rnowosielski  ยท  3Comments

franklinwise picture franklinwise  ยท  3Comments

rjinski picture rjinski  ยท  3Comments