Skip to content

Commit

Permalink
new resource azurerm_mongo_cluster
Browse files Browse the repository at this point in the history
  • Loading branch information
sinbai committed Oct 12, 2024
1 parent e3b7b5d commit f313acb
Show file tree
Hide file tree
Showing 50 changed files with 3,014 additions and 1 deletion.
3 changes: 3 additions & 0 deletions .github/labeler-issue-triage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,9 @@ service/mixed-reality:
service/mobile-network:
- '### (|New or )Affected Resource\(s\)\/Data Source\(s\)((.|\n)*)azurerm_mobile_network((.|\n)*)###'

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

service/monitor:
- '### (|New or )Affected Resource\(s\)\/Data Source\(s\)((.|\n)*)azurerm_monitor_((.|\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 @@ -364,6 +364,11 @@ service/mobile-network:
- any-glob-to-any-file:
- internal/services/mobilenetwork/**/*

service/mongo-cluster:
- changed-files:
- any-glob-to-any-file:
- internal/services/mongocluster/**/*

service/monitor:
- changed-files:
- any-glob-to-any-file:
Expand Down
3 changes: 2 additions & 1 deletion .teamcity/components/generated/services.kt
Original file line number Diff line number Diff line change
Expand Up @@ -126,5 +126,6 @@ var services = mapOf(
"vmware" to "VMware",
"voiceservices" to "Voice Services",
"web" to "Web",
"workloads" to "Workloads"
"workloads" to "Workloads",
"mongocluster" to "mongocluster"
)
5 changes: 5 additions & 0 deletions internal/clients/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ import (
maps "github.com/hashicorp/terraform-provider-azurerm/internal/services/maps/client"
mixedreality "github.com/hashicorp/terraform-provider-azurerm/internal/services/mixedreality/client"
mobilenetwork "github.com/hashicorp/terraform-provider-azurerm/internal/services/mobilenetwork/client"
mongocluster "github.com/hashicorp/terraform-provider-azurerm/internal/services/mongocluster/client"
monitor "github.com/hashicorp/terraform-provider-azurerm/internal/services/monitor/client"
mssql "github.com/hashicorp/terraform-provider-azurerm/internal/services/mssql/client"
mssqlmanagedinstance "github.com/hashicorp/terraform-provider-azurerm/internal/services/mssqlmanagedinstance/client"
Expand Down Expand Up @@ -229,6 +230,7 @@ type Client struct {
MixedReality *mixedreality.Client
Monitor *monitor.Client
MobileNetwork *mobilenetwork.Client
MongoCluster *mongocluster.Client
MSSQL *mssql.Client
MSSQLManagedInstance *mssqlmanagedinstance.Client
MySQL *mysql.Client
Expand Down Expand Up @@ -507,6 +509,9 @@ func (client *Client) Build(ctx context.Context, o *common.ClientOptions) error
if client.MobileNetwork, err = mobilenetwork.NewClient(o); err != nil {
return fmt.Errorf("building clients for Mobile Network: %+v", err)
}
if client.MongoCluster, err = mongocluster.NewClient(o); err != nil {
return fmt.Errorf("building clients for Mongo Cluster: %+v", err)
}
if client.MSSQL, err = mssql.NewClient(o); err != nil {
return fmt.Errorf("building clients for MSSQL: %+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 @@ -80,6 +80,7 @@ import (
"github.com/hashicorp/terraform-provider-azurerm/internal/services/maps"
"github.com/hashicorp/terraform-provider-azurerm/internal/services/mixedreality"
"github.com/hashicorp/terraform-provider-azurerm/internal/services/mobilenetwork"
"github.com/hashicorp/terraform-provider-azurerm/internal/services/mongocluster"
"github.com/hashicorp/terraform-provider-azurerm/internal/services/monitor"
"github.com/hashicorp/terraform-provider-azurerm/internal/services/mssql"
"github.com/hashicorp/terraform-provider-azurerm/internal/services/mssqlmanagedinstance"
Expand Down Expand Up @@ -179,6 +180,7 @@ func SupportedTypedServices() []sdk.TypedServiceRegistration {
maintenance.Registration{},
managedhsm.Registration{},
mobilenetwork.Registration{},
mongocluster.Registration{},
monitor.Registration{},
mssql.Registration{},
mssqlmanagedinstance.Registration{},
Expand Down
28 changes: 28 additions & 0 deletions internal/services/mongocluster/client/client.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
// Copyright (c) HashiCorp, Inc.
// SPDX-License-Identifier: MPL-2.0

package client

import (
"fmt"

"github.com/hashicorp/go-azure-sdk/resource-manager/mongocluster/2024-07-01/mongoclusters"
"github.com/hashicorp/terraform-provider-azurerm/internal/common"
)

type Client struct {
MongoClustersClient *mongoclusters.MongoClustersClient
}

func NewClient(o *common.ClientOptions) (*Client, error) {

mongoClustersClient, err := mongoclusters.NewMongoClustersClientWithBaseURI(o.Environment.ResourceManager)
if err != nil {
return nil, fmt.Errorf("building MongoClusters client: %+v", err)
}
o.Configure(mongoClustersClient.Client, o.Authorizers.ResourceManager)

return &Client{
MongoClustersClient: mongoClustersClient,
}, nil
}
Loading

0 comments on commit f313acb

Please sign in to comment.