Skip to content
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

The provider "X" does not support moved operations across resource types and providers #1039

Closed
grongor opened this issue Sep 16, 2024 · 4 comments · Fixed by #1038
Closed
Labels
bug Something isn't working
Milestone

Comments

@grongor
Copy link
Contributor

grongor commented Sep 16, 2024

I've spent several hours trying to figure out why I can't use the moved block with my provider...and I'm quite sure the reason is that nobody actually bothered to test this functionality before. I may be wrong, but...PR #1038 fixes it. Also see hashicorp/terraform-plugin-go#432.

Module version

v1.11.0

Relevant provider source code

func (r *MyResource) MoveState(ctx context.Context) []resource.StateMover {
	panic("this never gets executed")
}

Terraform Configuration Files

moved {
  from = my_old_resource.lorem
  to   = my_resource.ipsum
}

Debug Output

I think it's not relevant

Expected Behavior

I'd expect to see a panic...or to be more precise, I'd expect that terraform plan would execute the MoveState method of my providers resource.

Actual Behavior

│ Error: Unsupported `moved` across resource types
│
│   on main.tf line 135:
│  135: moved {
│
│ The provider "X" does not support moved operations across resource types and providers.

Steps to Reproduce

Try implement the move in your provider.

References

#1038
hashicorp/terraform-plugin-go#432

@grongor grongor added the bug Something isn't working label Sep 16, 2024
@pascal-hofmann
Copy link

I just ran into the same issue. Thanks for your work @grongor.

Would be great to get this fixed or to get some documentation in case we are missing something here.

@austinvalle
Copy link
Member

Hey all 👋🏻, that definitely is a bug in framework, I'll take a look at the PRs soon. Not sure how this was missed, but I'd guess there aren't a ton of usages of MoveResource outside of the major providers (aws mostly), which all rely on terraform-plugin-mux that has it's own surfacing of capabilities.

Regardless, we'll get this fixed and release a patch fix for framework + plugin-go sometime this week.

@pascal-hofmann
Copy link

Awesome, thanks for the quick reaction!

@austinvalle
Copy link
Member

The fix has been merged (alongside additional logging that will be released in a new version of terraform-plugin-go) and will be released later this week.

For development, if you'd like to test out the changes before that:

go get -u github.com/hashicorp/terraform-plugin-go@94d8cc586c2073a1206149acde3768d35b9e77b7
go get -u github.com/hashicorp/terraform-plugin-framework@ba1098a5813d88ab817ba1c8d70a6d1b58793660

go mod tidy

Note that both Go modules will also be updated to require minimum Go 1.22, so you may also need to bump your Go version for your provider


Thanks to @grongor for the PRs! 🎸

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants