From db3fd15ba0c106a9cf649baa958b43089f7bf7a6 Mon Sep 17 00:00:00 2001 From: tombuildsstuff Date: Thu, 16 Feb 2023 14:19:04 +0100 Subject: [PATCH] r/private_endpoint: updating the resource provider name This should be Microsoft.Cache rather than Microsoft.Redis, which differs from other RP's caught by @wiebeck here https://github.com/hashicorp/terraform-provider-azurerm/pull/20418#discussion_r1107662469 --- .../services/network/private_endpoint_resource.go | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/internal/services/network/private_endpoint_resource.go b/internal/services/network/private_endpoint_resource.go index 3620a9e14bbe..d25b08695c4f 100644 --- a/internal/services/network/private_endpoint_resource.go +++ b/internal/services/network/private_endpoint_resource.go @@ -1132,6 +1132,12 @@ func validatePrivateEndpointSettings(d *pluginsdk.ResourceData) error { // normalize the PrivateConnectionId due to the casing change at service side func normalizePrivateConnectionId(privateConnectionId string) string { + // intentionally including the extra segment to handle Redis vs Redis Enterprise (which is within the same RP) + if strings.Contains(strings.ToLower(privateConnectionId), "microsoft.cache/redis/") { + if cacheId, err := redis.ParseRediIDInsensitively(privateConnectionId); err == nil { + privateConnectionId = cacheId.ID() + } + } if strings.Contains(strings.ToLower(privateConnectionId), "microsoft.dbforpostgresql") { if serverId, err := postgresqlServers.ParseServerIDInsensitively(privateConnectionId); err == nil { privateConnectionId = serverId.ID() @@ -1147,11 +1153,6 @@ func normalizePrivateConnectionId(privateConnectionId string) string { privateConnectionId = serverId.ID() } } - if strings.Contains(strings.ToLower(privateConnectionId), "microsoft.redis") { - if cacheId, err := redis.ParseRediIDInsensitively(privateConnectionId); err == nil { - privateConnectionId = cacheId.ID() - } - } if strings.Contains(strings.ToLower(privateConnectionId), "microsoft.signalrservice") { if serviceId, err := signalr.ParseSignalRIDInsensitively(privateConnectionId); err == nil { privateConnectionId = serviceId.ID()