Skip to content

Conversation

@jhiza
Copy link

@jhiza jhiza commented Nov 13, 2025

Fixes #482

Related to support ticket number 319582

Summary

Fixes two "Provider produced inconsistent result after apply" errors in fivetran_destination:

  1. PrivateLink + Databricks: Preserves server_host_name and cloud_provider when API modifies them
  2. Setup Tests: Preserves private_link_id, networking_method, and hybrid_deployment_agent_id when toggling run_setup_tests

Changes

  • Added preservePrivateLinkConfigValues() helper function
  • Modified Create() and Update() to preserve plan config for PrivateLink scenarios
  • Modified Update() to preserve networking fields when running setup tests only
  • Added 2 comprehensive unit tests that simulate the problematic API behaviors
  • Updated CHANGELOG.md

Testing

  • Unit tests added for both scenarios
  • Manually tested with real Azure Databricks + PrivateLink configuration
  • No linter errors
  • Scoped to avoid side effects on other destination types

Impact

  • Unblocks users deploying Databricks on Azure with PrivateLink
  • Removes need for lifecycle.ignore_changes workaround
  • Enables proper configuration drift detection

Breaking Changes

None - this is a bug fix only

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
@jhiza jhiza marked this pull request as draft November 13, 2025 11:37
@jhiza jhiza marked this pull request as ready for review November 13, 2025 11:47
@jhiza jhiza marked this pull request as draft November 13, 2025 12:11
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
@jhiza
Copy link
Author

jhiza commented Nov 26, 2025

OK, the support ticket on the server side has been resolved with a code push, now can move forward with this review.

@jhiza jhiza marked this pull request as ready for review November 26, 2025 22:24
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 this pull request may close these issues.

Multiple "Provider produced inconsistent result after apply" errors with fivetran_destination

1 participant