Skip to content

Commit

Permalink
support new resource compute fleet
Browse files Browse the repository at this point in the history
  • Loading branch information
sinbai committed Feb 13, 2025
1 parent cadc7d1 commit 12b281e
Show file tree
Hide file tree
Showing 112 changed files with 19,508 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 @@ -74,6 +74,9 @@ service/cognitive-services:
service/communication:
- '### (|New or )Affected Resource\(s\)\/Data Source\(s\)((.|\n)*)azurerm_(communication_service|email_communication_service|gallery_application|orchestrated_virtual_machine_scale_set\W+|restore_point_collection|virtual_machine_gallery_application_assignment\W+|virtual_machine_implicit_data_disk_from_source\W+|virtual_machine_restore_point\W+|virtual_machine_restore_point_collection\W+|virtual_machine_run_command\W+)((.|\n)*)###'

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

service/connections:
- '### (|New or )Affected Resource\(s\)\/Data Source\(s\)((.|\n)*)azurerm_(api_connection|managed_api)((.|\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 @@ -123,6 +123,11 @@ service/communication:
- any-glob-to-any-file:
- internal/services/communication/**/*

service/compute-fleet:
- changed-files:
- any-glob-to-any-file:
- internal/services/computefleet/**/*

service/connections:
- 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 @@ -26,6 +26,7 @@ var services = mapOf(
"cognitive" to "Cognitive Services",
"communication" to "Communication",
"compute" to "Compute",
"computefleet" to "Compute Fleet",
"confidentialledger" to "Confidential Ledger",
"connections" to "Connections",
"consumption" to "Consumption",
Expand Down
6 changes: 6 additions & 0 deletions internal/clients/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ package clients
import (
"context"
"fmt"
computeFleet "github.com/hashicorp/terraform-provider-azurerm/internal/services/computefleet/client"

"github.com/Azure/go-autorest/autorest"
"github.com/Azure/go-autorest/autorest/validation"
Expand Down Expand Up @@ -182,6 +183,7 @@ type Client struct {
Cognitive *cognitiveServices.Client
Communication *communication.Client
Compute *compute.Client
ComputeFleet *computeFleet.Client
ConfidentialLedger *confidentialledger.Client
Connections *connections.Client
Consumption *consumption.Client
Expand Down Expand Up @@ -370,9 +372,13 @@ func (client *Client) Build(ctx context.Context, o *common.ClientOptions) error
if client.Compute, err = compute.NewClient(o); err != nil {
return fmt.Errorf("building clients for Compute: %+v", err)
}
if client.ComputeFleet, err = computeFleet.NewClient(o); err != nil {
return fmt.Errorf("building clients for Compute Fleet: %+v", err)
}
if client.ConfidentialLedger, err = confidentialledger.NewClient(o); err != nil {
return fmt.Errorf("building clients for ConfidentialLedger: %+v", err)
}

if client.Connections, err = connections.NewClient(o); err != nil {
return fmt.Errorf("building clients for Connections: %+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 @@ -28,6 +28,7 @@ import (
"github.com/hashicorp/terraform-provider-azurerm/internal/services/cognitive"
"github.com/hashicorp/terraform-provider-azurerm/internal/services/communication"
"github.com/hashicorp/terraform-provider-azurerm/internal/services/compute"
"github.com/hashicorp/terraform-provider-azurerm/internal/services/computefleet"
"github.com/hashicorp/terraform-provider-azurerm/internal/services/confidentialledger"
"github.com/hashicorp/terraform-provider-azurerm/internal/services/connections"
"github.com/hashicorp/terraform-provider-azurerm/internal/services/consumption"
Expand Down Expand Up @@ -157,6 +158,7 @@ func SupportedTypedServices() []sdk.TypedServiceRegistration {
cognitive.Registration{},
communication.Registration{},
compute.Registration{},
computefleet.Registration{},
consumption.Registration{},
containerapps.Registration{},
cosmos.Registration{},
Expand Down
24 changes: 24 additions & 0 deletions internal/services/computefleet/client/client.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
package client

import (
"fmt"

"github.com/hashicorp/go-azure-sdk/resource-manager/azurefleet/2024-11-01/fleets"
"github.com/hashicorp/terraform-provider-azurerm/internal/common"
)

type Client struct {
ComputeFleetClient *fleets.FleetsClient
}

func NewClient(o *common.ClientOptions) (*Client, error) {
computeFleetsClient, err := fleets.NewFleetsClientWithBaseURI(o.Environment.ResourceManager)
if err != nil {
return nil, fmt.Errorf("building compute fleet client: %+v", err)
}
o.Configure(computeFleetsClient.Client, o.Authorizers.ResourceManager)

return &Client{
ComputeFleetClient: computeFleetsClient,
}, nil
}
1,820 changes: 1,820 additions & 0 deletions internal/services/computefleet/compute_fleet_resource.go

Large diffs are not rendered by default.

Loading

0 comments on commit 12b281e

Please sign in to comment.