diff --git a/.changelog/4859.txt b/.changelog/4859.txt new file mode 100644 index 0000000000..e8880bba67 --- /dev/null +++ b/.changelog/4859.txt @@ -0,0 +1,3 @@ +```release-note:bug +resource/cloudflare_teams_location: Fix import failures on teams locations +``` diff --git a/internal/sdkv2provider/resource_cloudflare_teams_location.go b/internal/sdkv2provider/resource_cloudflare_teams_location.go index 5b2301ae66..fcf8f855c0 100644 --- a/internal/sdkv2provider/resource_cloudflare_teams_location.go +++ b/internal/sdkv2provider/resource_cloudflare_teams_location.go @@ -386,6 +386,9 @@ func flattenTeamsLocationNetworksIntoList(networks []cloudflare.TeamsLocationNet } func flattenTeamsEndpoints(endpoint *cloudflare.TeamsLocationEndpoints) []interface{} { + if endpoint == nil { + return nil + } flattenedEndpoints := map[string]interface{}{ "ipv4": flattenTeamsEndpointIpv4Field(endpoint.IPv4Endpoint), "ipv6": flattenTeamsEndpointIpv6Field(endpoint.IPv6Endpoint),