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

azurerm_security_center_subscription_pricing: Upgrade to API 2023-01-01 #21531

Merged
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
6 changes: 3 additions & 3 deletions internal/services/securitycenter/client/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package client

import (
"github.com/Azure/azure-sdk-for-go/services/preview/security/mgmt/v3.0/security" // nolint: staticcheck
pricings_v2022_03_01 "github.com/hashicorp/go-azure-sdk/resource-manager/security/2022-03-01/pricings"
pricings_v2023_01_01 "github.com/hashicorp/go-azure-sdk/resource-manager/security/2023-01-01/pricings"
"github.com/hashicorp/terraform-provider-azurerm/internal/common"
)

Expand All @@ -12,7 +12,7 @@ type Client struct {
ContactsClient *security.ContactsClient
DeviceSecurityGroupsClient *security.DeviceSecurityGroupsClient
IotSecuritySolutionClient *security.IotSecuritySolutionClient
PricingClient *pricings_v2022_03_01.PricingsClient
PricingClient *pricings_v2023_01_01.PricingsClient
WorkspaceClient *security.WorkspaceSettingsClient
AdvancedThreatProtectionClient *security.AdvancedThreatProtectionClient
AutoProvisioningClient *security.AutoProvisioningSettingsClient
Expand All @@ -39,7 +39,7 @@ func NewClient(o *common.ClientOptions) *Client {
IotSecuritySolutionClient := security.NewIotSecuritySolutionClientWithBaseURI(o.ResourceManagerEndpoint, o.SubscriptionId, ascLocation)
o.ConfigureClient(&IotSecuritySolutionClient.Client, o.ResourceManagerAuthorizer)

PricingClient := pricings_v2022_03_01.NewPricingsClientWithBaseURI(o.ResourceManagerEndpoint)
PricingClient := pricings_v2023_01_01.NewPricingsClientWithBaseURI(o.ResourceManagerEndpoint)
o.ConfigureClient(&PricingClient.Client, o.ResourceManagerAuthorizer)

WorkspaceClient := security.NewWorkspaceSettingsClientWithBaseURI(o.ResourceManagerEndpoint, o.SubscriptionId, ascLocation)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (

"github.com/Azure/azure-sdk-for-go/services/preview/security/mgmt/v3.0/security" // nolint: staticcheck
"github.com/hashicorp/go-azure-helpers/lang/response"
pricings_v2022_03_01 "github.com/hashicorp/go-azure-sdk/resource-manager/security/2022-03-01/pricings"
pricings_v2023_01_01 "github.com/hashicorp/go-azure-sdk/resource-manager/security/2023-01-01/pricings"
"github.com/hashicorp/terraform-provider-azurerm/internal/clients"
"github.com/hashicorp/terraform-provider-azurerm/internal/services/securitycenter/migration"
"github.com/hashicorp/terraform-provider-azurerm/internal/services/securitycenter/parse"
Expand Down Expand Up @@ -87,10 +87,10 @@ func resourceSecurityCenterSubscriptionPricingUpdate(d *pluginsdk.ResourceData,

// TODO: add a requires import check ensuring this is != Free (meaning we should likely remove Free as a SKU option?)

id := pricings_v2022_03_01.NewPricingID(subscriptionId, d.Get("resource_type").(string))
pricing := pricings_v2022_03_01.Pricing{
Properties: &pricings_v2022_03_01.PricingProperties{
PricingTier: pricings_v2022_03_01.PricingTier(d.Get("tier").(string)),
id := pricings_v2023_01_01.NewPricingID(subscriptionId, d.Get("resource_type").(string))
pricing := pricings_v2023_01_01.Pricing{
Properties: &pricings_v2023_01_01.PricingProperties{
PricingTier: pricings_v2023_01_01.PricingTier(d.Get("tier").(string)),
},
}

Expand All @@ -111,7 +111,7 @@ func resourceSecurityCenterSubscriptionPricingRead(d *pluginsdk.ResourceData, me
ctx, cancel := timeouts.ForRead(meta.(*clients.Client).StopContext, d)
defer cancel()

id, err := pricings_v2022_03_01.ParsePricingID(d.Id())
id, err := pricings_v2023_01_01.ParsePricingID(d.Id())
if err != nil {
return err
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"fmt"
"testing"

pricings_v2022_03_01 "github.com/hashicorp/go-azure-sdk/resource-manager/security/2022-03-01/pricings"
pricings_v2023_01_01 "github.com/hashicorp/go-azure-sdk/resource-manager/security/2023-01-01/pricings"
"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 TestAccSecurityCenterSubscriptionPricing_storageAccountSubplan(t *testing.T
}

func (SecurityCenterSubscriptionPricingResource) Exists(ctx context.Context, clients *clients.Client, state *pluginsdk.InstanceState) (*bool, error) {
id, err := pricings_v2022_03_01.ParsePricingIDInsensitively(state.ID)
id, err := pricings_v2023_01_01.ParsePricingIDInsensitively(state.ID)
if err != nil {
return nil, err
}
Expand Down

This file was deleted.

This file was deleted.

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

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

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

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

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

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

2 changes: 1 addition & 1 deletion vendor/modules.txt
Original file line number Diff line number Diff line change
Expand Up @@ -533,7 +533,7 @@ github.com/hashicorp/go-azure-sdk/resource-manager/search/2022-09-01/adminkeys
github.com/hashicorp/go-azure-sdk/resource-manager/search/2022-09-01/querykeys
github.com/hashicorp/go-azure-sdk/resource-manager/search/2022-09-01/services
github.com/hashicorp/go-azure-sdk/resource-manager/search/2022-09-01/sharedprivatelinkresources
github.com/hashicorp/go-azure-sdk/resource-manager/security/2022-03-01/pricings
github.com/hashicorp/go-azure-sdk/resource-manager/security/2023-01-01/pricings
github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-10-01-preview/alertrules
github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-10-01-preview/automationrules
github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-10-01-preview/metadata
Expand Down