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

Fix replacement of resources when updating a provider field or switching provider #13

Open
tenstad opened this issue Aug 29, 2021 · 4 comments · Fixed by #14
Open

Fix replacement of resources when updating a provider field or switching provider #13

tenstad opened this issue Aug 29, 2021 · 4 comments · Fixed by #14
Assignees

Comments

@tenstad
Copy link
Owner

tenstad commented Aug 29, 2021

Changing the host in the provider's conn should force replacement of all remote_files without a conn defined.

Issue caused by using default conn values defined in the provider configuration when conn is not defined within the resource.

@tenstad tenstad changed the title Fix replacement of resources when updating provider's conn host. Fix replacement of resources when updating provider's conn host Aug 29, 2021
@tenstad tenstad changed the title Fix replacement of resources when updating provider's conn host Fix replacement of resources when updating provider's connhost Aug 29, 2021
@tenstad tenstad self-assigned this Aug 29, 2021
This was referenced Aug 29, 2021
@tenstad tenstad reopened this Aug 29, 2021
@tenstad
Copy link
Owner Author

tenstad commented Aug 29, 2021

ForceNew does not seem to work with Computed. Behaviour is that "file does not exist" when refreshing state after updating the providers host (or that files are simply not moved when modifying the provider's default conn?).

NOTE: CustomizeDiff does not currently support computed/"known after apply" values from other resource attributes.
https://www.terraform.io/docs/extend/resources/customizing-differences.html

@tenstad
Copy link
Owner Author

tenstad commented Sep 16, 2021

A test case in internal/provider/move_file_test.go has now been created to illustrate the issue.

@tenstad
Copy link
Owner Author

tenstad commented Feb 4, 2022

Related issue hashicorp/terraform#29294

@tenstad
Copy link
Owner Author

tenstad commented Feb 6, 2022

Update: result_conn is removed as its sensitive fields were displayed. Although result_conn were able to store the provider's configuration in state, it did not resolve this issue.

@tenstad tenstad changed the title Fix replacement of resources when updating provider's connhost Fix replacement of resources when updating a provider field or switching provider Feb 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant