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

New service: DeviceRegistry + new resources: azurerm_device_registry_asset and azurerm_device_registry_asset_endpoint_profile #28399

Open
wants to merge 34 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
aab6731
boilerplate service code
mryanlo Dec 25, 2024
4c3f492
boilerplate service package
mryanlo Dec 30, 2024
d68570d
AEP resource
mryanlo Dec 30, 2024
9608e73
fix build errors and lints
mryanlo Dec 30, 2024
a8d1a18
lint
mryanlo Dec 30, 2024
9397281
cleanup and lint for AEP
mryanlo Dec 30, 2024
96b2367
update aep + asset resource
mryanlo Dec 31, 2024
4c3891e
vendor dependencies
mryanlo Dec 31, 2024
8c9fdd8
update codeowners to add device registry required reviewers for devic…
mryanlo Dec 31, 2024
7a1b1a5
fix build errors in aep and asset resource types
mryanlo Dec 31, 2024
287a79c
remove untyped service
mryanlo Dec 31, 2024
32aced7
run `go generate ./internal/provider`
mryanlo Dec 31, 2024
2033c9a
documentation for asset and AEP resources, removing asset and AEP rea…
mryanlo Jan 28, 2025
6d24814
fix aep resource bugs
mryanlo Jan 31, 2025
3ef00f4
simplify update logic for aep auth methods
mryanlo Feb 3, 2025
54394e5
fix bugs in asset resource
mryanlo Feb 3, 2025
bdb3547
documentation example updates
mryanlo Feb 3, 2025
5435de0
remove attributes fields from documentation
mryanlo Feb 4, 2025
e3ef30f
rough draft of tests
mryanlo Feb 7, 2025
36600f5
Merge branch 'main' of https://github.com/mryanlo/terraform-provider-…
mryanlo Feb 7, 2025
09a5eb4
add kind.yaml
mryanlo Feb 7, 2025
547600d
snake case aep names to fix validation errors
mryanlo Feb 8, 2025
62e4291
lint
mryanlo Feb 8, 2025
4ec9666
delete aio cluster setup scripts, make asset tests, change aep tests …
mryanlo Feb 19, 2025
505965b
add comment
mryanlo Feb 19, 2025
f2669aa
add back documentation uri update asset
mryanlo Feb 19, 2025
a38f5c7
fix asset test
mryanlo Feb 19, 2025
e877e4f
Merge branch 'main' of https://github.com/mryanlo/terraform-provider-…
mryanlo Feb 19, 2025
546a79f
add github label issue triage
mryanlo Feb 19, 2025
eab55f2
fix lint issues
mryanlo Feb 20, 2025
31c12f7
fix github labeler triage bug by adding the github label method to cl…
mryanlo Feb 20, 2025
cd6c6f9
update codeowners
mryanlo Feb 25, 2025
4dbcf64
change resource logic to poll for create and update functions
mryanlo Feb 28, 2025
41e54a3
fix build
mryanlo Feb 28, 2025
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
3 changes: 3 additions & 0 deletions .github/labeler-issue-triage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,9 @@ service/datadog:
service/dev-center:
- '### (|New or )Affected Resource\(s\)\/Data Source\(s\)((.|\n)*)azurerm_dev_center((.|\n)*)###'

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

service/devtestlabs:
- '### (|New or )Affected Resource\(s\)\/Data Source\(s\)((.|\n)*)azurerm_dev_test_((.|\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 @@ -198,6 +198,11 @@ service/dev-center:
- any-glob-to-any-file:
- internal/services/devcenter/**/*

service/deviceregistry:
- changed-files:
- any-glob-to-any-file:
- internal/services/deviceregistry/**/*

service/devtestlabs:
- 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 @@ -46,6 +46,7 @@ var services = mapOf(
"desktopvirtualization" to "Desktop Virtualization",
"devcenter" to "Dev Center",
"devtestlabs" to "Dev Test",
"deviceregistry" to "Device Registry",
"digitaltwins" to "Digital Twins",
"domainservices" to "DomainServices",
"dynatrace" to "Dynatrace",
Expand Down
3 changes: 3 additions & 0 deletions CODEOWNERS
Original file line number Diff line number Diff line change
@@ -1 +1,4 @@
* @hashicorp/terraform-azure

# PRLabel: %Device Registry
/internal/services/deviceregistry/ @marcodalessandro @rohankhandelwal @riteshrao @davidemontanari
5 changes: 5 additions & 0 deletions internal/clients/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ import (
dataprotection "github.com/hashicorp/terraform-provider-azurerm/internal/services/dataprotection/client"
datashare "github.com/hashicorp/terraform-provider-azurerm/internal/services/datashare/client"
desktopvirtualization "github.com/hashicorp/terraform-provider-azurerm/internal/services/desktopvirtualization/client"
deviceregistry "github.com/hashicorp/terraform-provider-azurerm/internal/services/deviceregistry/client"
devtestlabs "github.com/hashicorp/terraform-provider-azurerm/internal/services/devtestlabs/client"
digitaltwins "github.com/hashicorp/terraform-provider-azurerm/internal/services/digitaltwins/client"
dns "github.com/hashicorp/terraform-provider-azurerm/internal/services/dns/client"
Expand Down Expand Up @@ -199,6 +200,7 @@ type Client struct {
DataProtection *dataprotection.Client
DataShare *datashare.Client
DesktopVirtualization *desktopvirtualization.Client
DeviceRegistry *deviceregistry.Client
DevTestLabs *devtestlabs.Client
DigitalTwins *digitaltwins.Client
Dns *dns_v2018_05_01.Client
Expand Down Expand Up @@ -421,6 +423,9 @@ func (client *Client) Build(ctx context.Context, o *common.ClientOptions) error
if client.DesktopVirtualization, err = desktopvirtualization.NewClient(o); err != nil {
return fmt.Errorf("building clients for DesktopVirtualization: %+v", err)
}
if client.DeviceRegistry, err = deviceregistry.NewClient(o); err != nil {
return fmt.Errorf("building clients for DeviceRegistry: %+v", err)
}
if client.DevTestLabs, err = devtestlabs.NewClient(o); err != nil {
return fmt.Errorf("building clients for DevTestLabs: %+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 @@ -45,6 +45,7 @@ import (
"github.com/hashicorp/terraform-provider-azurerm/internal/services/dataprotection"
"github.com/hashicorp/terraform-provider-azurerm/internal/services/datashare"
"github.com/hashicorp/terraform-provider-azurerm/internal/services/desktopvirtualization"
"github.com/hashicorp/terraform-provider-azurerm/internal/services/deviceregistry"
"github.com/hashicorp/terraform-provider-azurerm/internal/services/devtestlabs"
"github.com/hashicorp/terraform-provider-azurerm/internal/services/digitaltwins"
"github.com/hashicorp/terraform-provider-azurerm/internal/services/dns"
Expand Down Expand Up @@ -167,6 +168,7 @@ func SupportedTypedServices() []sdk.TypedServiceRegistration {
datafactory.Registration{},
dataprotection.Registration{},
desktopvirtualization.Registration{},
deviceregistry.Registration{},
digitaltwins.Registration{},
dns.Registration{},
domainservices.Registration{},
Expand Down
34 changes: 34 additions & 0 deletions internal/services/deviceregistry/client/client.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
package client

import (
"fmt"

"github.com/hashicorp/go-azure-sdk/resource-manager/deviceregistry/2024-11-01/assetendpointprofiles"
"github.com/hashicorp/go-azure-sdk/resource-manager/deviceregistry/2024-11-01/assets"

"github.com/hashicorp/terraform-provider-azurerm/internal/common"
)

type Client struct {
AssetClient *assets.AssetsClient
AssetEndpointProfileClient *assetendpointprofiles.AssetEndpointProfilesClient
}

func NewClient(o *common.ClientOptions) (*Client, error) {
assetEndpointProfileClient, err := assetendpointprofiles.NewAssetEndpointProfilesClientWithBaseURI(o.Environment.ResourceManager)
if err != nil {
return nil, fmt.Errorf("creating AssetEndpointProfiles Client: %+v", err)
}
o.Configure(assetEndpointProfileClient.Client, o.Authorizers.ResourceManager)

assetClient, err := assets.NewAssetsClientWithBaseURI(o.Environment.ResourceManager)
if err != nil {
return nil, fmt.Errorf("creating Asset Client: %+v", err)
}
o.Configure(assetClient.Client, o.Authorizers.ResourceManager)

return &Client{
AssetClient: assetClient,
AssetEndpointProfileClient: assetEndpointProfileClient,
}, nil
}
Loading