From d9eb19f68b252f984e48b4afcb440a5491f84b86 Mon Sep 17 00:00:00 2001 From: Kyriakos Oikonomakos Date: Fri, 19 Nov 2021 18:14:31 +0000 Subject: [PATCH] Swap Relay parser and validator with EventHub (#14277) --- .../monitor/monitor_diagnostic_setting_resource.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/internal/services/monitor/monitor_diagnostic_setting_resource.go b/internal/services/monitor/monitor_diagnostic_setting_resource.go index 7feba9103eed..ab5f467dc2df 100644 --- a/internal/services/monitor/monitor_diagnostic_setting_resource.go +++ b/internal/services/monitor/monitor_diagnostic_setting_resource.go @@ -7,13 +7,12 @@ import ( "strings" "time" - "github.com/hashicorp/terraform-provider-azurerm/internal/services/relay/sdk/2017-04-01/namespaces" - "github.com/Azure/azure-sdk-for-go/services/preview/monitor/mgmt/2021-07-01-preview/insights" "github.com/hashicorp/go-azure-helpers/lang/response" "github.com/hashicorp/terraform-provider-azurerm/helpers/azure" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" + authRuleParse "github.com/hashicorp/terraform-provider-azurerm/internal/services/eventhub/sdk/2017-04-01/authorizationrulesnamespaces" eventhubValidate "github.com/hashicorp/terraform-provider-azurerm/internal/services/eventhub/validate" logAnalyticsParse "github.com/hashicorp/terraform-provider-azurerm/internal/services/loganalytics/parse" logAnalyticsValidate "github.com/hashicorp/terraform-provider-azurerm/internal/services/loganalytics/validate" @@ -68,7 +67,7 @@ func resourceMonitorDiagnosticSetting() *pluginsdk.Resource { Type: pluginsdk.TypeString, Optional: true, ForceNew: true, - ValidateFunc: namespaces.ValidateAuthorizationRuleID, + ValidateFunc: authRuleParse.ValidateAuthorizationRuleID, }, "log_analytics_workspace_id": { @@ -316,7 +315,8 @@ func resourceMonitorDiagnosticSettingRead(d *pluginsdk.ResourceData, meta interf d.Set("eventhub_name", resp.EventHubName) eventhubAuthorizationRuleId := "" if resp.EventHubAuthorizationRuleID != nil && *resp.EventHubAuthorizationRuleID != "" { - parsedId, err := namespaces.ParseAuthorizationRuleIDInsensitively(*resp.EventHubAuthorizationRuleID) + authRuleId := utils.NormalizeNilableString(resp.EventHubAuthorizationRuleID) + parsedId, err := authRuleParse.ParseAuthorizationRuleID(authRuleId) if err != nil { return err }