Skip to content

command: Add state replace-provider subcommand#24523

Merged
alisdair merged 2 commits intomasterfrom
alisdair/terraform-state-replace-provider
Apr 2, 2020
Merged

command: Add state replace-provider subcommand#24523
alisdair merged 2 commits intomasterfrom
alisdair/terraform-state-replace-provider

Conversation

@alisdair
Copy link
Copy Markdown
Contributor

@alisdair alisdair commented Apr 1, 2020

Terraform 0.13 will allow the installation of providers from various sources. If a user updates their configuration to change the source of an in-use provider (for example, if the provider namespace changes), they will also need to update the state file accordingly.

This commit introduces a new state replace-provider subcommand which supports this. All resources using the from provider will be updated to use the to provider.

Screenshots

success

cancelled

no-matches

invalid

@alisdair alisdair self-assigned this Apr 1, 2020
@ghost ghost added the sdkv1 [PRs only] Marks changes that may potentially need to be ported to the plugi nSDK label Apr 1, 2020
Copy link
Copy Markdown
Contributor

@mildwonkey mildwonkey left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is fantastic! 🎉

@codecov
Copy link
Copy Markdown

codecov bot commented Apr 1, 2020

Codecov Report

Merging #24523 into master will increase coverage by 0.04%.
The diff coverage is 75.78%.

Impacted Files Coverage Δ
commands.go 1.04% <0.00%> (-0.03%) ⬇️
command/state_replace_provider.go 78.76% <78.76%> (ø)
addrs/provider.go 65.35% <100.00%> (ø)
command/state_meta.go 51.66% <100.00%> (+2.99%) ⬆️
command/meta.go 68.72% <0.00%> (+0.47%) ⬆️

@alisdair alisdair force-pushed the alisdair/terraform-state-replace-provider branch 2 times, most recently from a680ce5 to da613b3 Compare April 1, 2020 19:33
alisdair added 2 commits April 2, 2020 08:15
Terraform 0.13 will allow the installation of providers from various
sources. If a user updates their configuration to change the source of
an in-use provider (for example, if the provider namespace changes),
they will also need to update the state file accordingly.

This commit introduces a new `state replace-provider` subcommand which
supports this. All resources using the `from` provider will be updated
to use the `to` provider.
This previously rendered as `Invalid provider type ""`, as `name` was
empty if parsing failed. Using the source string is more helpful.
@alisdair alisdair force-pushed the alisdair/terraform-state-replace-provider branch from da613b3 to cadc133 Compare April 2, 2020 12:16
@alisdair
Copy link
Copy Markdown
Contributor Author

alisdair commented Apr 2, 2020

Updated the UI after some rounds of iteration:

success

@alisdair alisdair merged commit 2c70fbb into master Apr 2, 2020
@alisdair alisdair deleted the alisdair/terraform-state-replace-provider branch April 2, 2020 13:35
@ghost
Copy link
Copy Markdown

ghost commented May 3, 2020

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.

@ghost ghost locked and limited conversation to collaborators May 3, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

sdkv1 [PRs only] Marks changes that may potentially need to be ported to the plugi nSDK

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants