Deprecate the tfmigrate plan --out=tfplan option #63
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Closes #62
The tfmigrate plan --out=tfplan option was originally requested in #36, and added in #37.
While testing Terraform 1.1 support, I found it no longer work with Terraform 1.1. #62
After debugging, the tfmigrate plan --out=tfplan option was based on a bug prior to Terraform 1.1.
Since terraform state push increments the serial of tfstate, a saved plan file in tfmigrate plan phase should not be able to terraform apply. However, prior to Terraform 1.1, there was no proper validation and terraform apply allows a such case incorrectly. Starting from Terraform 1.1, it now rejects the plan as stale, which seems to be a correct behavior.
That is, the tfmigrate plan --out=tfplan option doesn't work with Terraform 1.1 or later. There is no way to do this.
Fortunately, Terraform 1.1 added a new
moved
block feature, so some use-cases could be covered by themoved
block.So, I decided to deprecate the tfmigrate plan --out=tfplan option without replacement and it will be removed in a future release.