Skip to content

add support for multiple v4 names in GetResourceRename#231

Draft
ssicard wants to merge 4 commits intomainfrom
ssicard/rename-bug
Draft

add support for multiple v4 names in GetResourceRename#231
ssicard wants to merge 4 commits intomainfrom
ssicard/rename-bug

Conversation

@ssicard
Copy link
Collaborator

@ssicard ssicard commented Mar 12, 2026

Adds support for resources with multiple v4 names to get supported by GetResourceRename() and tests to verify

Context

GetResourceRename() is used during global post-processing to update the name of any resource that is being referenced within the block of another resource. It would have failed for the "secondary" name for any resource that had multiple v4 names, and one did not correspond to a v5 name.

Rename Types

  • no rename (46 resources)
    • cloudflare_argo > cloudflare_argo
  • 1:1 rename (6 resources)
    • cloudflare_access_policy > cloudflare_zero_trust_access_policy
  • 2:1 rename (20 resources)
    • one of the v4 corresponds to a v5
      • cloudflare_tunnel_config > cloudflare_zero_trust_tunnel_cloudflared_config
      • cloudflare_zero_trust_tunnel_cloudflared_config > cloudflare_zero_trust_tunnel_cloudflared_config
    • none of the v4 names corresponds to a v5 name
      • cloudflare_tunnel_virtual_network > cloudflare_zero_trust_tunnel_cloudflared_virtual_network
      • cloudflare_zero_trust_tunnel_virtual_network > cloudflare_zero_trust_tunnel_cloudflared_virtual_network
  • 1:2 rename, TODO (2 resources)
    • authenticated_origin_pulls > authenticated_origin_pulls
    • authenticated_origin_pulls > authenticated_origin_pulls_settings
  • 2:2 rename, TODO (1 resource)
    • [cloudflare_dlp_profile, cloudflare_zero_trust_dlp_profile] → cloudflare_zero_trust_dlp_custom_profile
    • [cloudflare_dlp_profile, cloudflare_zero_trust_dlp_profile] → cloudflare_zero_trust_dlp_predefined_profile

Additional Changes:

  • removed GetResourceRename() checks from unit tests, there is no logic in it
  • adds missing GetResourceRename() for queue and zero_trust_gateway_certificate
  • only adds a moved block if the resource name changes, not unconditionally
  • update agents.md

@ssicard ssicard self-assigned this Mar 12, 2026
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