Skip to content

Commit

Permalink
Remove alias from import section for 2024-02-01 API...
Browse files Browse the repository at this point in the history
  • Loading branch information
WodansSon committed Dec 5, 2024
1 parent c75fbb4 commit c5a1f6f
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 25 deletions.
6 changes: 3 additions & 3 deletions internal/services/cdn/cdn_frontdoor_origin_resource.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import (
"github.com/hashicorp/go-azure-helpers/lang/response"
"github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema"
"github.com/hashicorp/go-azure-helpers/resourcemanager/location"
cdnProfile "github.com/hashicorp/go-azure-sdk/resource-manager/cdn/2024-02-01/profiles"
"github.com/hashicorp/go-azure-sdk/resource-manager/cdn/2024-02-01/profiles"
"github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-11-01/privatelinkservices"
"github.com/hashicorp/terraform-provider-azurerm/helpers/azure"
"github.com/hashicorp/terraform-provider-azurerm/helpers/tf"
Expand Down Expand Up @@ -207,7 +207,7 @@ func resourceCdnFrontDoorOriginCreate(d *pluginsdk.ResourceData, meta interface{
// private links are only allowed in the premium sku...
profile := parse.NewFrontDoorProfileID(id.SubscriptionId, id.ResourceGroup, id.ProfileName)

profileId := cdnProfile.ProfileId{
profileId := profiles.ProfileId{
SubscriptionId: profile.SubscriptionId,
ResourceGroupName: profile.ResourceGroup,
ProfileName: profile.ProfileName,
Expand Down Expand Up @@ -378,7 +378,7 @@ func resourceCdnFrontDoorOriginUpdate(d *pluginsdk.ResourceData, meta interface{
// private links are only allowed in the premium sku...
profile := parse.NewFrontDoorProfileID(id.SubscriptionId, id.ResourceGroup, id.ProfileName)

profileId := cdnProfile.ProfileId{
profileId := profiles.ProfileId{
SubscriptionId: profile.SubscriptionId,
ResourceGroupName: profile.ResourceGroup,
ProfileName: profile.ProfileName,
Expand Down
4 changes: 2 additions & 2 deletions internal/services/cdn/cdn_frontdoor_profile_data_source.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (
"github.com/hashicorp/go-azure-helpers/lang/response"
"github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema"
"github.com/hashicorp/go-azure-helpers/resourcemanager/identity"
cdn "github.com/hashicorp/go-azure-sdk/resource-manager/cdn/2024-02-01/profiles"
"github.com/hashicorp/go-azure-sdk/resource-manager/cdn/2024-02-01/profiles"
"github.com/hashicorp/terraform-provider-azurerm/internal/clients"
"github.com/hashicorp/terraform-provider-azurerm/internal/services/cdn/parse"
"github.com/hashicorp/terraform-provider-azurerm/internal/services/cdn/validate"
Expand Down Expand Up @@ -66,7 +66,7 @@ func dataSourceCdnFrontDoorProfileRead(d *pluginsdk.ResourceData, meta interface

id := parse.NewFrontDoorProfileID(subscriptionId, d.Get("resource_group_name").(string), d.Get("name").(string))

profileId := cdn.ProfileId{
profileId := profiles.ProfileId{
SubscriptionId: id.SubscriptionId,
ResourceGroupName: id.ResourceGroup,
ProfileName: id.ProfileName,
Expand Down
26 changes: 13 additions & 13 deletions internal/services/cdn/cdn_frontdoor_profile_resource.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import (
"github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema"
"github.com/hashicorp/go-azure-helpers/resourcemanager/identity"
"github.com/hashicorp/go-azure-helpers/resourcemanager/location"
cdn "github.com/hashicorp/go-azure-sdk/resource-manager/cdn/2024-02-01/profiles"
"github.com/hashicorp/go-azure-sdk/resource-manager/cdn/2024-02-01/profiles"
"github.com/hashicorp/terraform-provider-azurerm/helpers/tf"
"github.com/hashicorp/terraform-provider-azurerm/internal/clients"
"github.com/hashicorp/terraform-provider-azurerm/internal/services/cdn/parse"
Expand Down Expand Up @@ -65,8 +65,8 @@ func resourceCdnFrontDoorProfile() *pluginsdk.Resource {
Required: true,
ForceNew: true,
ValidateFunc: validation.StringInSlice([]string{
string(cdn.SkuNamePremiumAzureFrontDoor),
string(cdn.SkuNameStandardAzureFrontDoor),
string(profiles.SkuNamePremiumAzureFrontDoor),
string(profiles.SkuNameStandardAzureFrontDoor),
}, false),
},

Expand All @@ -88,7 +88,7 @@ func resourceCdnFrontDoorProfileCreate(d *pluginsdk.ResourceData, meta interface

id := parse.NewFrontDoorProfileID(subscriptionId, d.Get("resource_group_name").(string), d.Get("name").(string))

profileId := cdn.ProfileId{
profileId := profiles.ProfileId{
SubscriptionId: id.SubscriptionId,
ResourceGroupName: id.ResourceGroup,
ProfileName: id.ProfileName,
Expand All @@ -105,13 +105,13 @@ func resourceCdnFrontDoorProfileCreate(d *pluginsdk.ResourceData, meta interface
return tf.ImportAsExistsError("azurerm_cdn_frontdoor_profile", id.ID())
}

props := cdn.Profile{
props := profiles.Profile{
Location: location.Normalize("global"),
Properties: &cdn.ProfileProperties{
Properties: &profiles.ProfileProperties{
OriginResponseTimeoutSeconds: pointer.To(int64(d.Get("response_timeout_seconds").(int))),
},
Sku: cdn.Sku{
Name: pointer.To(cdn.SkuName(d.Get("sku_name").(string))),
Sku: profiles.Sku{
Name: pointer.To(profiles.SkuName(d.Get("sku_name").(string))),
},
Tags: expandNewFrontDoorTagsPointer(d.Get("tags").(map[string]interface{})),
}
Expand Down Expand Up @@ -144,7 +144,7 @@ func resourceCdnFrontDoorProfileRead(d *pluginsdk.ResourceData, meta interface{}
return err
}

profileId := cdn.ProfileId{
profileId := profiles.ProfileId{
SubscriptionId: id.SubscriptionId,
ResourceGroupName: id.ResourceGroup,
ProfileName: id.ProfileName,
Expand Down Expand Up @@ -208,15 +208,15 @@ func resourceCdnFrontDoorProfileUpdate(d *pluginsdk.ResourceData, meta interface
return err
}

profileId := cdn.ProfileId{
profileId := profiles.ProfileId{
SubscriptionId: id.SubscriptionId,
ResourceGroupName: id.ResourceGroup,
ProfileName: id.ProfileName,
}

props := cdn.ProfileUpdateParameters{
props := profiles.ProfileUpdateParameters{
Tags: expandNewFrontDoorTagsPointer(d.Get("tags").(map[string]interface{})),
Properties: &cdn.ProfilePropertiesUpdateParameters{},
Properties: &profiles.ProfilePropertiesUpdateParameters{},
}

if d.HasChange("response_timeout_seconds") {
Expand Down Expand Up @@ -250,7 +250,7 @@ func resourceCdnFrontDoorProfileDelete(d *pluginsdk.ResourceData, meta interface
return err
}

profileId := cdn.ProfileId{
profileId := profiles.ProfileId{
SubscriptionId: id.SubscriptionId,
ResourceGroupName: id.ResourceGroup,
ProfileName: id.ProfileName,
Expand Down
4 changes: 2 additions & 2 deletions internal/services/cdn/cdn_frontdoor_profile_resource_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
"testing"

"github.com/hashicorp/go-azure-helpers/lang/response"
cdn "github.com/hashicorp/go-azure-sdk/resource-manager/cdn/2024-02-01/profiles"
"github.com/hashicorp/go-azure-sdk/resource-manager/cdn/2024-02-01/profiles"
"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 @@ -224,7 +224,7 @@ func (r CdnFrontDoorProfileResource) Exists(ctx context.Context, clients *client
return nil, err
}

profileId := cdn.ProfileId{
profileId := profiles.ProfileId{
SubscriptionId: id.SubscriptionId,
ResourceGroupName: id.ResourceGroup,
ProfileName: id.ProfileName,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (

"github.com/Azure/azure-sdk-for-go/services/cdn/mgmt/2021-06-01/cdn" // nolint: staticcheck
"github.com/hashicorp/go-azure-helpers/lang/pointer"
cdnProfile "github.com/hashicorp/go-azure-sdk/resource-manager/cdn/2024-02-01/profiles"
"github.com/hashicorp/go-azure-sdk/resource-manager/cdn/2024-02-01/profiles"
"github.com/hashicorp/terraform-provider-azurerm/helpers/tf"
"github.com/hashicorp/terraform-provider-azurerm/internal/clients"
cdnfrontdoorsecurityparams "github.com/hashicorp/terraform-provider-azurerm/internal/services/cdn/frontdoorsecurityparams"
Expand Down Expand Up @@ -150,7 +150,7 @@ func resourceCdnFrontdoorSecurityPolicyCreate(d *pluginsdk.ResourceData, meta in
return err
}

profileId := cdnProfile.ProfileId{
profileId := profiles.ProfileId{
SubscriptionId: profile.SubscriptionId,
ResourceGroupName: profile.ResourceGroup,
ProfileName: profile.ProfileName,
Expand Down
6 changes: 3 additions & 3 deletions internal/services/cdn/client/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
cdnSdk "github.com/Azure/azure-sdk-for-go/services/cdn/mgmt/2020-09-01/cdn" // nolint: staticcheck
cdnFrontDoorSdk "github.com/Azure/azure-sdk-for-go/services/cdn/mgmt/2021-06-01/cdn" // nolint: staticcheck
"github.com/Azure/azure-sdk-for-go/services/frontdoor/mgmt/2020-11-01/frontdoor" // nolint: staticcheck
cdnProfile "github.com/hashicorp/go-azure-sdk/resource-manager/cdn/2024-02-01/profiles"
"github.com/hashicorp/go-azure-sdk/resource-manager/cdn/2024-02-01/profiles"
"github.com/hashicorp/terraform-provider-azurerm/internal/common"
)

Expand All @@ -21,7 +21,7 @@ type Client struct {
FrontDoorSecurityPoliciesClient *cdnFrontDoorSdk.SecurityPoliciesClient
FrontDoorRoutesClient *cdnFrontDoorSdk.RoutesClient
FrontDoorRulesClient *cdnFrontDoorSdk.RulesClient
FrontDoorProfileClient *cdnProfile.ProfilesClient
FrontDoorProfileClient *profiles.ProfilesClient
FrontDoorSecretsClient *cdnFrontDoorSdk.SecretsClient
FrontDoorRuleSetsClient *cdnFrontDoorSdk.RuleSetsClient
FrontDoorLegacyFirewallPoliciesClient *frontdoor.PoliciesClient
Expand All @@ -31,7 +31,7 @@ type Client struct {
}

func NewClient(o *common.ClientOptions) (*Client, error) {
frontDoorProfilesClient, err := cdnProfile.NewProfilesClientWithBaseURI(o.Environment.ResourceManager)
frontDoorProfilesClient, err := profiles.NewProfilesClientWithBaseURI(o.Environment.ResourceManager)
if err != nil {
return nil, fmt.Errorf("building ProfilesClient: %+v", err)
}
Expand Down

0 comments on commit c5a1f6f

Please sign in to comment.