Skip to content

Commit

Permalink
New Resource: azurerm_extended_location_custom_location (#24267)
Browse files Browse the repository at this point in the history
* temp

* acc test

* extended location temp

* Fix test

* Update acc test

* Update extension type

* update test ext

* New Resource: azurerm_extended_location_custom_location

* update allowed cats

* fix gencheck issue

* Update to use commonschema

* address some comments

* update docs

* pass golint

* update to avoid nil dereference

* temp

* acc test

* extended location temp

* Fix test

* Update acc test

* Update extension type

* update test ext

* New Resource: azurerm_extended_location_custom_location

* fix conflict

* Added validation func, more acc test, updated script and docs

* change name validation func

* remove location overrride in acc tests

* Address comments, remove unused location overrides, add examples in doc

* Fix indent in client list

* address comments, change elem type, removing redundant code

* Update vendors

* update oid in python script, add more comments inline for users

* Address comments, remove some unupdatable attributes

* revert

* address comments on update

---------

Co-authored-by: Elena Xin (Centific Technologies Inc) <[email protected]>
  • Loading branch information
jiaweitao001 and sinbai authored Aug 13, 2024
1 parent a02cf62 commit 19ad4f1
Show file tree
Hide file tree
Showing 35 changed files with 2,353 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .github/labeler-issue-triage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,9 @@ service/event-grid:
service/event-hubs:
- '### (|New or )Affected Resource\(s\)\/Data Source\(s\)((.|\n)*)azurerm_eventhub((.|\n)*)###'

service/extended-location:
- '### (|New or )Affected Resource\(s\)\/Data Source\(s\)((.|\n)*)azurerm_extended_custom_location((.|\n)*)###'

service/firewall:
- '### (|New or )Affected Resource\(s\)\/Data Source\(s\)((.|\n)*)azurerm_firewall((.|\n)*)###'

Expand Down
5 changes: 5 additions & 0 deletions .github/labeler-pull-request-triage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,11 @@ service/event-hubs:
- any-glob-to-any-file:
- internal/services/eventhub/**/*

service/extended-location:
- changed-files:
- any-glob-to-any-file:
- internal/services/extendedlocation/**/*

service/firewall:
- changed-files:
- any-glob-to-any-file:
Expand Down
1 change: 1 addition & 0 deletions .teamcity/components/generated/services.kt
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ var services = mapOf(
"elasticsan" to "ElasticSan",
"eventgrid" to "EventGrid",
"eventhub" to "EventHub",
"extendedlocation" to "ExtendedLocation",
"firewall" to "Firewall",
"fluidrelay" to "Fluid Relay",
"frontdoor" to "FrontDoor",
Expand Down
5 changes: 5 additions & 0 deletions internal/clients/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ import (
elasticsan "github.com/hashicorp/terraform-provider-azurerm/internal/services/elasticsan/client"
eventgrid "github.com/hashicorp/terraform-provider-azurerm/internal/services/eventgrid/client"
eventhub "github.com/hashicorp/terraform-provider-azurerm/internal/services/eventhub/client"
extendedlocation "github.com/hashicorp/terraform-provider-azurerm/internal/services/extendedlocation/client"
fluidrelay "github.com/hashicorp/terraform-provider-azurerm/internal/services/fluidrelay/client"
frontdoor "github.com/hashicorp/terraform-provider-azurerm/internal/services/frontdoor/client"
graph "github.com/hashicorp/terraform-provider-azurerm/internal/services/graphservices/client"
Expand Down Expand Up @@ -210,6 +211,7 @@ type Client struct {
ElasticSan *elasticsan.Client
EventGrid *eventgrid_v2022_06_15.Client
Eventhub *eventhub.Client
ExtendedLocation *extendedlocation.Client
FluidRelay *fluidrelay_2022_05_26.Client
Frontdoor *frontdoor.Client
Graph *graph.Client
Expand Down Expand Up @@ -447,6 +449,9 @@ func (client *Client) Build(ctx context.Context, o *common.ClientOptions) error
if client.Eventhub, err = eventhub.NewClient(o); err != nil {
return fmt.Errorf("building clients for Eventhub: %+v", err)
}
if client.ExtendedLocation, err = extendedlocation.NewClient(o); err != nil {
return fmt.Errorf("building clients for ExtendedLocation: %+v", err)
}
if client.FluidRelay, err = fluidrelay.NewClient(o); err != nil {
return fmt.Errorf("building clients for FluidRelay: %+v", err)
}
Expand Down
2 changes: 2 additions & 0 deletions internal/provider/services.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ import (
"github.com/hashicorp/terraform-provider-azurerm/internal/services/elasticsan"
"github.com/hashicorp/terraform-provider-azurerm/internal/services/eventgrid"
"github.com/hashicorp/terraform-provider-azurerm/internal/services/eventhub"
"github.com/hashicorp/terraform-provider-azurerm/internal/services/extendedlocation"
"github.com/hashicorp/terraform-provider-azurerm/internal/services/firewall"
"github.com/hashicorp/terraform-provider-azurerm/internal/services/fluidrelay"
"github.com/hashicorp/terraform-provider-azurerm/internal/services/frontdoor"
Expand Down Expand Up @@ -171,6 +172,7 @@ func SupportedTypedServices() []sdk.TypedServiceRegistration {
domainservices.Registration{},
elasticsan.Registration{},
eventhub.Registration{},
extendedlocation.Registration{},
fluidrelay.Registration{},
graphservices.Registration{},
hybridcompute.Registration{},
Expand Down
27 changes: 27 additions & 0 deletions internal/services/extendedlocation/client/client.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
// Copyright (c) HashiCorp, Inc.
// SPDX-License-Identifier: MPL-2.0

package client

import (
"fmt"

"github.com/hashicorp/go-azure-sdk/resource-manager/extendedlocation/2021-08-15/customlocations"
"github.com/hashicorp/terraform-provider-azurerm/internal/common"
)

type Client struct {
CustomLocationsClient *customlocations.CustomLocationsClient
}

func NewClient(o *common.ClientOptions) (*Client, error) {
customLocationsClient, err := customlocations.NewCustomLocationsClientWithBaseURI(o.Environment.ResourceManager)
if err != nil {
return nil, fmt.Errorf("building CustomLocations client: %+v", err)
}
o.Configure(customLocationsClient.Client, o.Authorizers.ResourceManager)

return &Client{
CustomLocationsClient: customLocationsClient,
}, nil
}
Loading

0 comments on commit 19ad4f1

Please sign in to comment.