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 Resource : azurerm_mongo_cluster #27636

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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 @@ -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
1 change: 1 addition & 0 deletions .teamcity/components/generated/services.kt
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ var services = mapOf(
"mssqlmanagedinstance" to "Microsoft SQL Server Managed Instances",
"mixedreality" to "Mixed Reality",
"mobilenetwork" to "Mobile Network",
"mongocluster" to "Mongo Cluster",
"monitor" to "Monitor",
"mysql" to "MySQL",
"netapp" to "NetApp",
Expand Down
5 changes: 5 additions & 0 deletions internal/clients/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,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 @@ -228,6 +229,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 @@ -180,6 +181,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
Loading