Skip to content

Commit

Permalink
update application gateway data source and resource to use hashicorp/…
Browse files Browse the repository at this point in the history
…go-azure-sdk
  • Loading branch information
stephybun committed May 3, 2024
1 parent e089d2d commit 2fffb1e
Show file tree
Hide file tree
Showing 3 changed files with 667 additions and 778 deletions.
18 changes: 9 additions & 9 deletions internal/services/network/application_gateway_data_source.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,16 @@ package network

import (
"fmt"
"github.com/hashicorp/go-azure-helpers/lang/response"
"github.com/hashicorp/go-azure-helpers/resourcemanager/identity"
"github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-09-01/applicationgateways"
"time"

"github.com/hashicorp/go-azure-helpers/lang/pointer"
"github.com/hashicorp/go-azure-helpers/lang/response"
"github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema"
"github.com/hashicorp/go-azure-helpers/resourcemanager/identity"
"github.com/hashicorp/go-azure-helpers/resourcemanager/location"
"github.com/hashicorp/go-azure-helpers/resourcemanager/tags"
"github.com/hashicorp/go-azure-helpers/resourcemanager/zones"
"github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-09-01/applicationgateways"
"github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-09-01/webapplicationfirewallpolicies"
"github.com/hashicorp/terraform-provider-azurerm/internal/clients"
"github.com/hashicorp/terraform-provider-azurerm/internal/services/network/parse"
Expand Down Expand Up @@ -1469,7 +1469,7 @@ func dataSourceApplicationGatewayRead(d *pluginsdk.ResourceData, meta interface{
return fmt.Errorf("setting `custom_error_configuration`: %+v", setErr)
}

urlPathMaps, err := flattenApplicationGatewayURLPathMaps(props.URLPathMaps)
urlPathMaps, err := flattenApplicationGatewayURLPathMaps(props.UrlPathMaps)
if err != nil {
return fmt.Errorf("flattening `url_path_map`: %+v", err)
}
Expand All @@ -1482,8 +1482,8 @@ func dataSourceApplicationGatewayRead(d *pluginsdk.ResourceData, meta interface{
}

firewallPolicyId := ""
if props.FirewallPolicy != nil && props.FirewallPolicy.ID != nil {
firewallPolicyId = *props.FirewallPolicy.ID
if props.FirewallPolicy != nil && props.FirewallPolicy.Id != nil {
firewallPolicyId = *props.FirewallPolicy.Id
policyId, err := webapplicationfirewallpolicies.ParseApplicationGatewayWebApplicationFirewallPolicyIDInsensitively(firewallPolicyId)
if err == nil {
firewallPolicyId = policyId.ID()
Expand Down Expand Up @@ -1532,15 +1532,15 @@ func flattenApplicationGatewayDataSourceSslProfiles(input *[]applicationgateways
output["ssl_policy"] = flattenApplicationGatewaySslPolicy(props.SslPolicy)
}

if props := v.ApplicationGatewaySslProfilePropertiesFormat; props != nil {
if props := v.Properties; props != nil {
trustedClientCertificateNames := make([]interface{}, 0)
if certs := props.TrustedClientCertificates; certs != nil {
for _, cert := range *certs {
if cert.ID == nil {
if cert.Id == nil {
continue
}

certId, err := parse.TrustedClientCertificateIDInsensitively(*cert.ID)
certId, err := parse.TrustedClientCertificateIDInsensitively(*cert.Id)
if err != nil {
return nil, err
}
Expand Down
Loading

0 comments on commit 2fffb1e

Please sign in to comment.