-
Notifications
You must be signed in to change notification settings - Fork 9.1k
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
aws_elasticache_replication_group: Implement noop MigrateState for v0..v1 #8887
Merged
Merged
Changes from 3 commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
ca38834
aws_elasticache_replication_group: Implement no-op MigrateState from …
akatrevorjay ac20102
gofmt
akatrevorjay 122b8d5
Merge remote-tracking branch 'upstream/master' into upgrade-0.12
akatrevorjay dbc10a0
Swap MigrateState to one requested by reviewer.
akatrevorjay File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since this is an exceptional case and we want to perform the simplest possible upgrade for compatibility, can you please inline this with the following comments?
I verified this successfully with a Terraform AWS Provider 1.13.0
aws_elasticache_replication_group
resource on Terraform 0.12.1. 👍There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure, I'll swap over. I do find the replacement more error prone, but either way is fine by me.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @akatrevorjay, the passthrough implementation is not more error prone --
MigrateState
and dealing with flatmap state migrations in of the Terraform v0.12's Provider SDK has been superseded with JSON state migrations viaStateUpgraders
. In this case, we do not need to worry about doing anything other than passing through the existingInstanceState
to bypass the Terraform runtime error, which matches the Terraform v0.11 Provider SDK in this situation whereMigrateState
was not implemented alongside aSchemaVersion
update. We'll be removing the upstream runtime error in the next version of Terraform v0.12 (hashicorp/terraform#21625) to match the old Terraform v0.11 behavior.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Aha! I didn't see any mention of
StateUpgraders
in the docs at the time of writing this, I'm guessing I must have missed it! Thanks so much for the explanation!