Skip to content

Commit

Permalink
dependencies - azurerm_network_security_rule swap to `hashicorp/go-…
Browse files Browse the repository at this point in the history
…azure-sdk` (#22242)

* azurerm_network_security_rule swap to hashicorp/go-azure-sdk

* goimports

---------

Co-authored-by: Steph <[email protected]>
  • Loading branch information
mbfrahry and stephybun authored Jun 27, 2023
1 parent a3250c1 commit 66fee07
Show file tree
Hide file tree
Showing 41 changed files with 1,373 additions and 1,318 deletions.
12 changes: 8 additions & 4 deletions internal/services/network/client/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import (
"github.com/hashicorp/go-azure-sdk/resource-manager/network/2022-09-01/routetables"
"github.com/hashicorp/go-azure-sdk/resource-manager/network/2022-09-01/scopeconnections"
"github.com/hashicorp/go-azure-sdk/resource-manager/network/2022-09-01/securityadminconfigurations"
"github.com/hashicorp/go-azure-sdk/resource-manager/network/2022-09-01/securityrules"
"github.com/hashicorp/go-azure-sdk/resource-manager/network/2022-09-01/staticmembers"
"github.com/hashicorp/terraform-provider-azurerm/internal/common"
"github.com/tombuildsstuff/kermit/sdk/network/2022-07-01/network"
Expand Down Expand Up @@ -62,7 +63,7 @@ type Client struct {
RouteTablesClient *routetables.RouteTablesClient
SecurityGroupClient *network.SecurityGroupsClient
SecurityPartnerProviderClient *network.SecurityPartnerProvidersClient
SecurityRuleClient *network.SecurityRulesClient
SecurityRuleClient *securityrules.SecurityRulesClient
ServiceEndpointPoliciesClient *network.ServiceEndpointPoliciesClient
ServiceEndpointPolicyDefinitionsClient *network.ServiceEndpointPolicyDefinitionsClient
ServiceTagsClient *network.ServiceTagsClient
Expand Down Expand Up @@ -267,8 +268,11 @@ func NewClient(o *common.ClientOptions) (*Client, error) {
SecurityPartnerProviderClient := network.NewSecurityPartnerProvidersClientWithBaseURI(o.ResourceManagerEndpoint, o.SubscriptionId)
o.ConfigureClient(&SecurityPartnerProviderClient.Client, o.ResourceManagerAuthorizer)

SecurityRuleClient := network.NewSecurityRulesClientWithBaseURI(o.ResourceManagerEndpoint, o.SubscriptionId)
o.ConfigureClient(&SecurityRuleClient.Client, o.ResourceManagerAuthorizer)
SecurityRuleClient, err := securityrules.NewSecurityRulesClientWithBaseURI(o.Environment.ResourceManager)
if err != nil {
return nil, fmt.Errorf("building network security rule client: %+v", err)
}
o.Configure(SecurityRuleClient.Client, o.Authorizers.ResourceManager)

ServiceEndpointPoliciesClient := network.NewServiceEndpointPoliciesClientWithBaseURI(o.ResourceManagerEndpoint, o.SubscriptionId)
o.ConfigureClient(&ServiceEndpointPoliciesClient.Client, o.ResourceManagerAuthorizer)
Expand Down Expand Up @@ -370,7 +374,7 @@ func NewClient(o *common.ClientOptions) (*Client, error) {
RouteTablesClient: RouteTablesClient,
SecurityGroupClient: &SecurityGroupClient,
SecurityPartnerProviderClient: &SecurityPartnerProviderClient,
SecurityRuleClient: &SecurityRuleClient,
SecurityRuleClient: SecurityRuleClient,
ServiceEndpointPoliciesClient: &ServiceEndpointPoliciesClient,
ServiceEndpointPolicyDefinitionsClient: &ServiceEndpointPolicyDefinitionsClient,
ServiceTagsClient: &ServiceTagsClient,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ import (

"github.com/Azure/go-autorest/autorest"
"github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema"
"github.com/hashicorp/go-azure-sdk/resource-manager/network/2022-09-01/routefilters"
"github.com/hashicorp/terraform-provider-azurerm/helpers/tf"
"github.com/hashicorp/terraform-provider-azurerm/internal/clients"
"github.com/hashicorp/terraform-provider-azurerm/internal/locks"
"github.com/hashicorp/terraform-provider-azurerm/internal/services/network/parse"
"github.com/hashicorp/terraform-provider-azurerm/internal/services/network/validate"
"github.com/hashicorp/terraform-provider-azurerm/internal/tf/pluginsdk"
"github.com/hashicorp/terraform-provider-azurerm/internal/tf/validation"
"github.com/hashicorp/terraform-provider-azurerm/internal/timeouts"
Expand Down Expand Up @@ -200,7 +200,7 @@ func resourceExpressRouteCircuitPeering() *pluginsdk.Resource {
"route_filter_id": {
Type: pluginsdk.TypeString,
Optional: true,
ValidateFunc: validate.RouteFilterID,
ValidateFunc: routefilters.ValidateRouteFilterID,
},
},
},
Expand All @@ -224,7 +224,7 @@ func resourceExpressRouteCircuitPeering() *pluginsdk.Resource {
"route_filter_id": {
Type: pluginsdk.TypeString,
Optional: true,
ValidateFunc: validate.RouteFilterID,
ValidateFunc: routefilters.ValidateRouteFilterID,
},

"gateway_manager_etag": {
Expand Down Expand Up @@ -486,7 +486,7 @@ func expandExpressRouteCircuitIpv6PeeringConfig(input []interface{}) (*network.I

routeFilterId := v["route_filter_id"].(string)
if routeFilterId != "" {
if _, err := parse.RouteFilterID(routeFilterId); err != nil {
if _, err := routefilters.ParseRouteFilterID(routeFilterId); err != nil {
return nil, err
}
peeringConfig.RouteFilter = &network.SubResource{
Expand Down
Loading

0 comments on commit 66fee07

Please sign in to comment.