Skip to content

Commit

Permalink
Merge pull request #20418 from hashicorp/b/private-endpoint
Browse files Browse the repository at this point in the history
r/private_endpoint: normalizing the private_connection_resource_id for a redis cache
  • Loading branch information
tombuildsstuff committed Feb 13, 2023
2 parents 878c611 + 707313c commit 6cc061c
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions internal/services/network/private_endpoint_resource.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import (
mariaDB "github.com/hashicorp/go-azure-sdk/resource-manager/mariadb/2018-06-01/servers"
"github.com/hashicorp/go-azure-sdk/resource-manager/postgresql/2017-12-01/servers"
"github.com/hashicorp/go-azure-sdk/resource-manager/privatedns/2018-09-01/privatezones"
"github.com/hashicorp/go-azure-sdk/resource-manager/redis/2021-06-01/redis"
"github.com/hashicorp/go-azure-sdk/resource-manager/signalr/2022-02-01/signalr"
"github.com/hashicorp/terraform-provider-azurerm/helpers/azure"
"github.com/hashicorp/terraform-provider-azurerm/helpers/tf"
Expand Down Expand Up @@ -873,6 +874,11 @@ func flattenPrivateLinkEndpointServiceConnection(serviceConnections *[]network.P
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()
Expand Down

0 comments on commit 6cc061c

Please sign in to comment.