Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade PaloAltoNetworks.Firewalls API version from 2022-08-29 to 2023-09-01 #24290

Merged
merged 3 commits into from
Jan 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion internal/services/paloalto/client/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,14 @@ import (
"fmt"

paloalto_2022_08_29 "github.com/hashicorp/go-azure-sdk/resource-manager/paloaltonetworks/2022-08-29"
paloalto_2023_09_01 "github.com/hashicorp/go-azure-sdk/resource-manager/paloaltonetworks/2023-09-01"
"github.com/hashicorp/go-azure-sdk/sdk/client/resourcemanager"
"github.com/hashicorp/terraform-provider-azurerm/internal/common"
)

type Client struct {
*paloalto_2022_08_29.Client
PaloAltoClient_v2023_09_01 *paloalto_2023_09_01.Client
}

func NewClient(o *common.ClientOptions) (*Client, error) {
Expand All @@ -20,7 +22,15 @@ func NewClient(o *common.ClientOptions) (*Client, error) {
return nil, fmt.Errorf("building clients for Network: %+v", err)
}

paloAltoClient_v2023_09_01, err := paloalto_2023_09_01.NewClientWithBaseURI(o.Environment.ResourceManager, func(c *resourcemanager.Client) {
o.Configure(c, o.Authorizers.ResourceManager)
})
if err != nil {
return nil, err
}

return &Client{
Client: client,
Client: client,
PaloAltoClient_v2023_09_01: paloAltoClient_v2023_09_01,
}, nil
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ import (
"github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema"
"github.com/hashicorp/go-azure-helpers/resourcemanager/location"
"github.com/hashicorp/go-azure-helpers/resourcemanager/tags"
"github.com/hashicorp/go-azure-sdk/resource-manager/paloaltonetworks/2022-08-29/firewalls"
"github.com/hashicorp/go-azure-sdk/resource-manager/paloaltonetworks/2022-08-29/localrulestacks"
"github.com/hashicorp/go-azure-sdk/resource-manager/paloaltonetworks/2023-09-01/firewalls"
"github.com/hashicorp/terraform-provider-azurerm/internal/locks"
"github.com/hashicorp/terraform-provider-azurerm/internal/sdk"
"github.com/hashicorp/terraform-provider-azurerm/internal/services/paloalto/schema"
Expand Down Expand Up @@ -82,7 +82,7 @@ func (r NextGenerationFirewallVHubLocalRuleStackResource) Create() sdk.ResourceF
return sdk.ResourceFunc{
Timeout: 3 * time.Hour,
Func: func(ctx context.Context, metadata sdk.ResourceMetaData) error {
client := metadata.Client.PaloAlto.Client.Firewalls
client := metadata.Client.PaloAlto.PaloAltoClient_v2023_09_01.Firewalls
localRuleStackClient := metadata.Client.PaloAlto.Client.LocalRulestacks
loc := ""
var model NextGenerationFirewallVHubLocalRuleStackModel
Expand Down Expand Up @@ -156,7 +156,7 @@ func (r NextGenerationFirewallVHubLocalRuleStackResource) Read() sdk.ResourceFun
return sdk.ResourceFunc{
Timeout: 5 * time.Minute,
Func: func(ctx context.Context, metadata sdk.ResourceMetaData) error {
client := metadata.Client.PaloAlto.Client.Firewalls
client := metadata.Client.PaloAlto.PaloAltoClient_v2023_09_01.Firewalls

id, err := firewalls.ParseFirewallID(metadata.ResourceData.Id())
if err != nil {
Expand Down Expand Up @@ -204,7 +204,7 @@ func (r NextGenerationFirewallVHubLocalRuleStackResource) Delete() sdk.ResourceF
return sdk.ResourceFunc{
Timeout: 2 * time.Hour,
Func: func(ctx context.Context, metadata sdk.ResourceMetaData) error {
client := metadata.Client.PaloAlto.Client.Firewalls
client := metadata.Client.PaloAlto.PaloAltoClient_v2023_09_01.Firewalls

id, err := firewalls.ParseFirewallID(metadata.ResourceData.Id())
if err != nil {
Expand All @@ -224,7 +224,7 @@ func (r NextGenerationFirewallVHubLocalRuleStackResource) Update() sdk.ResourceF
return sdk.ResourceFunc{
Timeout: 3 * time.Hour,
Func: func(ctx context.Context, metadata sdk.ResourceMetaData) error {
client := metadata.Client.PaloAlto.Client.Firewalls
client := metadata.Client.PaloAlto.PaloAltoClient_v2023_09_01.Firewalls

id, err := firewalls.ParseFirewallID(metadata.ResourceData.Id())
if err != nil {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (

"github.com/hashicorp/go-azure-helpers/lang/pointer"
"github.com/hashicorp/go-azure-helpers/lang/response"
"github.com/hashicorp/go-azure-sdk/resource-manager/paloaltonetworks/2022-08-29/firewalls"
"github.com/hashicorp/go-azure-sdk/resource-manager/paloaltonetworks/2023-09-01/firewalls"
"github.com/hashicorp/terraform-provider-azurerm/internal/acceptance"
"github.com/hashicorp/terraform-provider-azurerm/internal/acceptance/check"
"github.com/hashicorp/terraform-provider-azurerm/internal/clients"
Expand Down Expand Up @@ -114,7 +114,7 @@ func (r NextGenerationFirewallVWanResource) Exists(ctx context.Context, client *
return nil, err
}

resp, err := client.PaloAlto.Client.Firewalls.Get(ctx, *id)
resp, err := client.PaloAlto.PaloAltoClient_v2023_09_01.Firewalls.Get(ctx, *id)
if err != nil {
if response.WasNotFound(resp.HttpResponse) {
return pointer.To(false), nil
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (
"github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema"
"github.com/hashicorp/go-azure-helpers/resourcemanager/location"
"github.com/hashicorp/go-azure-helpers/resourcemanager/tags"
"github.com/hashicorp/go-azure-sdk/resource-manager/paloaltonetworks/2022-08-29/firewalls"
"github.com/hashicorp/go-azure-sdk/resource-manager/paloaltonetworks/2023-09-01/firewalls"
helpersValidate "github.com/hashicorp/terraform-provider-azurerm/helpers/validate"
"github.com/hashicorp/terraform-provider-azurerm/internal/sdk"
"github.com/hashicorp/terraform-provider-azurerm/internal/services/paloalto/schema"
Expand Down Expand Up @@ -87,7 +87,7 @@ func (r NextGenerationFirewallVHubPanoramaResource) Create() sdk.ResourceFunc {
return sdk.ResourceFunc{
Timeout: 2 * time.Hour,
Func: func(ctx context.Context, metadata sdk.ResourceMetaData) error {
client := metadata.Client.PaloAlto.Client.Firewalls
client := metadata.Client.PaloAlto.PaloAltoClient_v2023_09_01.Firewalls

var model NextGenerationFirewallVHubPanoramaResourceModel

Expand Down Expand Up @@ -144,7 +144,7 @@ func (r NextGenerationFirewallVHubPanoramaResource) Read() sdk.ResourceFunc {
return sdk.ResourceFunc{
Timeout: 5 * time.Minute,
Func: func(ctx context.Context, metadata sdk.ResourceMetaData) error {
client := metadata.Client.PaloAlto.Client.Firewalls
client := metadata.Client.PaloAlto.PaloAltoClient_v2023_09_01.Firewalls

id, err := firewalls.ParseFirewallID(metadata.ResourceData.Id())
if err != nil {
Expand Down Expand Up @@ -202,7 +202,7 @@ func (r NextGenerationFirewallVHubPanoramaResource) Delete() sdk.ResourceFunc {
return sdk.ResourceFunc{
Timeout: 2 * time.Hour,
Func: func(ctx context.Context, metadata sdk.ResourceMetaData) error {
client := metadata.Client.PaloAlto.Client.Firewalls
client := metadata.Client.PaloAlto.PaloAltoClient_v2023_09_01.Firewalls

id, err := firewalls.ParseFirewallID(metadata.ResourceData.Id())
if err != nil {
Expand All @@ -222,7 +222,7 @@ func (r NextGenerationFirewallVHubPanoramaResource) Update() sdk.ResourceFunc {
return sdk.ResourceFunc{
Timeout: 2 * time.Hour,
Func: func(ctx context.Context, metadata sdk.ResourceMetaData) error {
client := metadata.Client.PaloAlto.Client.Firewalls
client := metadata.Client.PaloAlto.PaloAltoClient_v2023_09_01.Firewalls

id, err := firewalls.ParseFirewallID(metadata.ResourceData.Id())
if err != nil {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (

"github.com/hashicorp/go-azure-helpers/lang/pointer"
"github.com/hashicorp/go-azure-helpers/lang/response"
"github.com/hashicorp/go-azure-sdk/resource-manager/paloaltonetworks/2022-08-29/firewalls"
"github.com/hashicorp/go-azure-sdk/resource-manager/paloaltonetworks/2023-09-01/firewalls"
"github.com/hashicorp/terraform-provider-azurerm/internal/acceptance"
"github.com/hashicorp/terraform-provider-azurerm/internal/acceptance/check"
"github.com/hashicorp/terraform-provider-azurerm/internal/clients"
Expand Down Expand Up @@ -96,7 +96,7 @@ func (r NextGenerationFirewallVHubPanoramaResource) Exists(ctx context.Context,
return nil, err
}

resp, err := client.PaloAlto.Client.Firewalls.Get(ctx, *id)
resp, err := client.PaloAlto.PaloAltoClient_v2023_09_01.Firewalls.Get(ctx, *id)
if err != nil {
if response.WasNotFound(resp.HttpResponse) {
return pointer.To(false), nil
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ import (
"github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema"
"github.com/hashicorp/go-azure-helpers/resourcemanager/location"
"github.com/hashicorp/go-azure-helpers/resourcemanager/tags"
"github.com/hashicorp/go-azure-sdk/resource-manager/paloaltonetworks/2022-08-29/firewalls"
"github.com/hashicorp/go-azure-sdk/resource-manager/paloaltonetworks/2022-08-29/localrulestacks"
"github.com/hashicorp/go-azure-sdk/resource-manager/paloaltonetworks/2023-09-01/firewalls"
"github.com/hashicorp/terraform-provider-azurerm/internal/locks"
"github.com/hashicorp/terraform-provider-azurerm/internal/sdk"
"github.com/hashicorp/terraform-provider-azurerm/internal/services/paloalto/schema"
Expand Down Expand Up @@ -77,7 +77,7 @@ func (r NextGenerationFirewallVNetLocalRulestackResource) Create() sdk.ResourceF
return sdk.ResourceFunc{
Timeout: 3 * time.Hour,
Func: func(ctx context.Context, metadata sdk.ResourceMetaData) error {
client := metadata.Client.PaloAlto.Client.Firewalls
client := metadata.Client.PaloAlto.PaloAltoClient_v2023_09_01.Firewalls
localRulestackClient := metadata.Client.PaloAlto.Client.LocalRulestacks

var model NextGenerationFirewallVnetLocalRulestackModel
Expand Down Expand Up @@ -150,7 +150,7 @@ func (r NextGenerationFirewallVNetLocalRulestackResource) Read() sdk.ResourceFun
return sdk.ResourceFunc{
Timeout: 5 * time.Minute,
Func: func(ctx context.Context, metadata sdk.ResourceMetaData) error {
client := metadata.Client.PaloAlto.Client.Firewalls
client := metadata.Client.PaloAlto.PaloAltoClient_v2023_09_01.Firewalls

id, err := firewalls.ParseFirewallID(metadata.ResourceData.Id())
if err != nil {
Expand Down Expand Up @@ -194,7 +194,7 @@ func (r NextGenerationFirewallVNetLocalRulestackResource) Delete() sdk.ResourceF
return sdk.ResourceFunc{
Timeout: 2 * time.Hour,
Func: func(ctx context.Context, metadata sdk.ResourceMetaData) error {
client := metadata.Client.PaloAlto.Client.Firewalls
client := metadata.Client.PaloAlto.PaloAltoClient_v2023_09_01.Firewalls

id, err := firewalls.ParseFirewallID(metadata.ResourceData.Id())
if err != nil {
Expand All @@ -218,7 +218,7 @@ func (r NextGenerationFirewallVNetLocalRulestackResource) Update() sdk.ResourceF
return sdk.ResourceFunc{
Timeout: 3 * time.Hour,
Func: func(ctx context.Context, metadata sdk.ResourceMetaData) error {
client := metadata.Client.PaloAlto.Client.Firewalls
client := metadata.Client.PaloAlto.PaloAltoClient_v2023_09_01.Firewalls

id, err := firewalls.ParseFirewallID(metadata.ResourceData.Id())
if err != nil {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (

"github.com/hashicorp/go-azure-helpers/lang/pointer"
"github.com/hashicorp/go-azure-helpers/lang/response"
"github.com/hashicorp/go-azure-sdk/resource-manager/paloaltonetworks/2022-08-29/firewalls"
"github.com/hashicorp/go-azure-sdk/resource-manager/paloaltonetworks/2023-09-01/firewalls"
"github.com/hashicorp/terraform-provider-azurerm/internal/acceptance"
"github.com/hashicorp/terraform-provider-azurerm/internal/acceptance/check"
"github.com/hashicorp/terraform-provider-azurerm/internal/clients"
Expand Down Expand Up @@ -108,7 +108,7 @@ func (r NextGenerationFirewallVnetResource) Exists(ctx context.Context, client *
return nil, err
}

resp, err := client.PaloAlto.Client.Firewalls.Get(ctx, *id)
resp, err := client.PaloAlto.PaloAltoClient_v2023_09_01.Firewalls.Get(ctx, *id)
if err != nil {
if response.WasNotFound(resp.HttpResponse) {
return pointer.To(false), nil
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (
"github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema"
"github.com/hashicorp/go-azure-helpers/resourcemanager/location"
"github.com/hashicorp/go-azure-helpers/resourcemanager/tags"
"github.com/hashicorp/go-azure-sdk/resource-manager/paloaltonetworks/2022-08-29/firewalls"
"github.com/hashicorp/go-azure-sdk/resource-manager/paloaltonetworks/2023-09-01/firewalls"
helpersValidate "github.com/hashicorp/terraform-provider-azurerm/helpers/validate"
"github.com/hashicorp/terraform-provider-azurerm/internal/sdk"
"github.com/hashicorp/terraform-provider-azurerm/internal/services/paloalto/schema"
Expand Down Expand Up @@ -82,7 +82,7 @@ func (r NextGenerationFirewallVNetPanoramaResource) Create() sdk.ResourceFunc {
return sdk.ResourceFunc{
Timeout: 3 * time.Hour,
Func: func(ctx context.Context, metadata sdk.ResourceMetaData) error {
client := metadata.Client.PaloAlto.Client.Firewalls
client := metadata.Client.PaloAlto.PaloAltoClient_v2023_09_01.Firewalls

var model NextGenerationFirewallVnetPanoramaModel

Expand Down Expand Up @@ -139,7 +139,7 @@ func (r NextGenerationFirewallVNetPanoramaResource) Read() sdk.ResourceFunc {
return sdk.ResourceFunc{
Timeout: 5 * time.Minute,
Func: func(ctx context.Context, metadata sdk.ResourceMetaData) error {
client := metadata.Client.PaloAlto.Client.Firewalls
client := metadata.Client.PaloAlto.PaloAltoClient_v2023_09_01.Firewalls

id, err := firewalls.ParseFirewallID(metadata.ResourceData.Id())
if err != nil {
Expand Down Expand Up @@ -193,7 +193,7 @@ func (r NextGenerationFirewallVNetPanoramaResource) Delete() sdk.ResourceFunc {
return sdk.ResourceFunc{
Timeout: 3 * time.Hour,
Func: func(ctx context.Context, metadata sdk.ResourceMetaData) error {
client := metadata.Client.PaloAlto.Client.Firewalls
client := metadata.Client.PaloAlto.PaloAltoClient_v2023_09_01.Firewalls

id, err := firewalls.ParseFirewallID(metadata.ResourceData.Id())
if err != nil {
Expand All @@ -217,7 +217,7 @@ func (r NextGenerationFirewallVNetPanoramaResource) Update() sdk.ResourceFunc {
return sdk.ResourceFunc{
Timeout: 3 * time.Hour,
Func: func(ctx context.Context, metadata sdk.ResourceMetaData) error {
client := metadata.Client.PaloAlto.Client.Firewalls
client := metadata.Client.PaloAlto.PaloAltoClient_v2023_09_01.Firewalls

id, err := firewalls.ParseFirewallID(metadata.ResourceData.Id())
if err != nil {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (

"github.com/hashicorp/go-azure-helpers/lang/pointer"
"github.com/hashicorp/go-azure-helpers/lang/response"
"github.com/hashicorp/go-azure-sdk/resource-manager/paloaltonetworks/2022-08-29/firewalls"
"github.com/hashicorp/go-azure-sdk/resource-manager/paloaltonetworks/2023-09-01/firewalls"
"github.com/hashicorp/terraform-provider-azurerm/internal/acceptance"
"github.com/hashicorp/terraform-provider-azurerm/internal/acceptance/check"
"github.com/hashicorp/terraform-provider-azurerm/internal/clients"
Expand Down Expand Up @@ -97,7 +97,7 @@ func (r NextGenerationFirewallVNetPanoramaResource) Exists(ctx context.Context,
return nil, err
}

resp, err := client.PaloAlto.Client.Firewalls.Get(ctx, *id)
resp, err := client.PaloAlto.PaloAltoClient_v2023_09_01.Firewalls.Get(ctx, *id)
if err != nil {
if response.WasNotFound(resp.HttpResponse) {
return pointer.To(false), nil
Expand Down
2 changes: 1 addition & 1 deletion internal/services/paloalto/schema/destination_nat.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"strconv"

"github.com/hashicorp/go-azure-helpers/lang/pointer"
"github.com/hashicorp/go-azure-sdk/resource-manager/paloaltonetworks/2022-08-29/firewalls"
"github.com/hashicorp/go-azure-sdk/resource-manager/paloaltonetworks/2023-09-01/firewalls"
helpersValidate "github.com/hashicorp/terraform-provider-azurerm/helpers/validate"
networkValidate "github.com/hashicorp/terraform-provider-azurerm/internal/services/network/validate"
"github.com/hashicorp/terraform-provider-azurerm/internal/services/paloalto/validate"
Expand Down
2 changes: 1 addition & 1 deletion internal/services/paloalto/schema/dns_settings.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package schema

import (
"github.com/hashicorp/go-azure-helpers/lang/pointer"
"github.com/hashicorp/go-azure-sdk/resource-manager/paloaltonetworks/2022-08-29/firewalls"
"github.com/hashicorp/go-azure-sdk/resource-manager/paloaltonetworks/2023-09-01/firewalls"
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
"github.com/hashicorp/terraform-provider-azurerm/helpers/validate"
"github.com/hashicorp/terraform-provider-azurerm/internal/tf/pluginsdk"
Expand Down
2 changes: 1 addition & 1 deletion internal/services/paloalto/schema/network_profile.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package schema
import (
"github.com/hashicorp/go-azure-helpers/lang/pointer"
"github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-06-01/networkvirtualappliances"
"github.com/hashicorp/go-azure-sdk/resource-manager/paloaltonetworks/2022-08-29/firewalls"
"github.com/hashicorp/go-azure-sdk/resource-manager/paloaltonetworks/2023-09-01/firewalls"
networkValidate "github.com/hashicorp/terraform-provider-azurerm/internal/services/network/validate"
"github.com/hashicorp/terraform-provider-azurerm/internal/tf/pluginsdk"
)
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading