Skip to content

Conversation

@rotem-cloud
Copy link
Collaborator

Add migration support for cloudflare_regional_hostname from provider v4
(SDKv2) to v5 (Plugin Framework).

Changes

  • Add routing field with default "dns" to state
  • Remove timeouts field from state and timeouts block from config
  • Set schema_version to 0
  • Preserve all user fields (zone_id, hostname, region_key)

Tests

Unit tests (16 tests, 75.0% coverage):

  • 7 config transformation tests (basic, count, for_each, timeouts removal)
  • 8 state transformation tests (routing addition, timeouts removal)
  • 1 edge case test (empty state)

Integration tests (14 resource instances):

  • All Terraform patterns: basic, count, for_each (map/set), conditional
  • Wildcard hostnames, functions, variables
  • Verifies zero data loss and correct field transformations

All tests passing ✓

Run tests:

go test ./internal/resources/regional_hostname/
TEST_RESOURCE=regional_hostname go test -v ./integration/v4_to_v5/

@rotem-cloud rotem-cloud force-pushed the rotem/regional_hostname_migration branch from ffa8cbe to 4a3853e Compare November 19, 2025 15:41
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.

1 participant