Fix state inconsistencies for fivetran_destination resource#483
Open
jhiza wants to merge 2 commits intofivetran:mainfrom
Open
Fix state inconsistencies for fivetran_destination resource#483jhiza wants to merge 2 commits intofivetran:mainfrom
jhiza wants to merge 2 commits intofivetran:mainfrom
Conversation
This commit fixes two related "Provider produced inconsistent result after apply" errors in the fivetran_destination resource: 1. PrivateLink with Databricks destinations When PrivateLink is configured, Fivetran's API returns modified values for server_host_name (PrivateLink endpoint) and cloud_provider (changed to AWS). The fix preserves the user's original configuration values by saving plan config before the API call and restoring it afterwards. 2. Changing run_setup_tests with networking fields When run_setup_tests changes from false to true without config changes, the provider runs setup tests using a legacy response that doesn't include networking fields (private_link_id, networking_method, hybrid_deployment_agent_id). The fix explicitly preserves these fields from state when only running tests. Both fixes are scoped to avoid side effects on other use cases. Changes: - Added preservePrivateLinkConfigValues() helper function - Modified Create() to save & restore plan config for PrivateLink - Modified Update() to save & restore plan config for PrivateLink - Modified Update() to preserve networking fields when running setup tests - Added TestResourceDestinationDatabricksPrivateLinkConfigPreservationMock() - Added TestResourceDestinationSetupTestsPreservesNetworkingFieldsMock() - Updated CHANGELOG.md with both fixes
This commit fixes multiple related "Provider produced inconsistent result after apply" errors in the fivetran_destination resource: 1. PrivateLink with Databricks destinations When PrivateLink is configured, Fivetran's API returns modified values for: - server_host_name (changed to PrivateLink endpoint) - cloud_provider (changed to AWS) - networking_method (changed to Directly) - private_link_id (cleared/emptied) The fix preserves ALL user's original configuration values by saving plan values before the API call and restoring them afterwards. 2. Changing run_setup_tests with networking fields When run_setup_tests changes from false to true without config changes, the provider runs setup tests using a legacy response that doesn't include networking fields (private_link_id, networking_method, hybrid_deployment_agent_id). The fix explicitly preserves these fields from state when only running tests. Both fixes are scoped to avoid side effects on other use cases. Changes: - Added preservePrivateLinkValues() helper function (renamed from preservePrivateLinkConfigValues) - Now preserves top-level networking_method and private_link_id fields - Modified Create() to save & restore plan values for PrivateLink - Modified Update() to save & restore plan values for PrivateLink - Modified Update() to preserve networking fields when running setup tests - Updated tests to verify all fields are preserved (including networking_method) - Updated CHANGELOG.md with comprehensive fix description
Author
|
OK, the support ticket on the server side has been resolved with a code push, now can move forward with this review. |
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Fixes #482
Related to support ticket number 319582
Summary
Fixes two "Provider produced inconsistent result after apply" errors in
fivetran_destination:server_host_nameandcloud_providerwhen API modifies themprivate_link_id,networking_method, andhybrid_deployment_agent_idwhen togglingrun_setup_testsChanges
preservePrivateLinkConfigValues()helper functionCreate()andUpdate()to preserve plan config for PrivateLink scenariosUpdate()to preserve networking fields when running setup tests onlyTesting
Impact
lifecycle.ignore_changesworkaroundBreaking Changes
None - this is a bug fix only