OVHCloud v2.0.7 published on Wednesday, Mar 19, 2025 by OVHcloud
ovh.CloudProject.getMongoDbUser
Explore with Pulumi AI
Use this data source to get information about a user of a mongodb cluster associated with a public cloud project.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as ovh from "@pulumi/ovh";
const mongoUser = ovh.CloudProject.getMongoDbUser({
    serviceName: "XXX",
    clusterId: "YYY",
    name: "ZZZ@admin",
});
export const mongoUserRoles = mongoUser.then(mongoUser => mongoUser.roles);
import pulumi
import pulumi_ovh as ovh
mongo_user = ovh.CloudProject.get_mongo_db_user(service_name="XXX",
    cluster_id="YYY",
    name="ZZZ@admin")
pulumi.export("mongoUserRoles", mongo_user.roles)
package main
import (
	"github.com/ovh/pulumi-ovh/sdk/v2/go/ovh/cloudproject"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		mongoUser, err := cloudproject.GetMongoDbUser(ctx, &cloudproject.GetMongoDbUserArgs{
			ServiceName: "XXX",
			ClusterId:   "YYY",
			Name:        "ZZZ@admin",
		}, nil)
		if err != nil {
			return err
		}
		ctx.Export("mongoUserRoles", mongoUser.Roles)
		return nil
	})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Ovh = Pulumi.Ovh;
return await Deployment.RunAsync(() => 
{
    var mongoUser = Ovh.CloudProject.GetMongoDbUser.Invoke(new()
    {
        ServiceName = "XXX",
        ClusterId = "YYY",
        Name = "ZZZ@admin",
    });
    return new Dictionary<string, object?>
    {
        ["mongoUserRoles"] = mongoUser.Apply(getMongoDbUserResult => getMongoDbUserResult.Roles),
    };
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.ovh.CloudProject.CloudProjectFunctions;
import com.pulumi.ovh.CloudProject.inputs.GetMongoDbUserArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
    public static void main(String[] args) {
        Pulumi.run(App::stack);
    }
    public static void stack(Context ctx) {
        final var mongoUser = CloudProjectFunctions.getMongoDbUser(GetMongoDbUserArgs.builder()
            .serviceName("XXX")
            .clusterId("YYY")
            .name("ZZZ@admin")
            .build());
        ctx.export("mongoUserRoles", mongoUser.applyValue(getMongoDbUserResult -> getMongoDbUserResult.roles()));
    }
}
variables:
  mongoUser:
    fn::invoke:
      function: ovh:CloudProject:getMongoDbUser
      arguments:
        serviceName: XXX
        clusterId: YYY
        name: ZZZ@admin
outputs:
  mongoUserRoles: ${mongoUser.roles}
Using getMongoDbUser
Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.
function getMongoDbUser(args: GetMongoDbUserArgs, opts?: InvokeOptions): Promise<GetMongoDbUserResult>
function getMongoDbUserOutput(args: GetMongoDbUserOutputArgs, opts?: InvokeOptions): Output<GetMongoDbUserResult>def get_mongo_db_user(cluster_id: Optional[str] = None,
                      name: Optional[str] = None,
                      service_name: Optional[str] = None,
                      opts: Optional[InvokeOptions] = None) -> GetMongoDbUserResult
def get_mongo_db_user_output(cluster_id: Optional[pulumi.Input[str]] = None,
                      name: Optional[pulumi.Input[str]] = None,
                      service_name: Optional[pulumi.Input[str]] = None,
                      opts: Optional[InvokeOptions] = None) -> Output[GetMongoDbUserResult]func GetMongoDbUser(ctx *Context, args *GetMongoDbUserArgs, opts ...InvokeOption) (*GetMongoDbUserResult, error)
func GetMongoDbUserOutput(ctx *Context, args *GetMongoDbUserOutputArgs, opts ...InvokeOption) GetMongoDbUserResultOutput> Note: This function is named GetMongoDbUser in the Go SDK.
public static class GetMongoDbUser 
{
    public static Task<GetMongoDbUserResult> InvokeAsync(GetMongoDbUserArgs args, InvokeOptions? opts = null)
    public static Output<GetMongoDbUserResult> Invoke(GetMongoDbUserInvokeArgs args, InvokeOptions? opts = null)
}public static CompletableFuture<GetMongoDbUserResult> getMongoDbUser(GetMongoDbUserArgs args, InvokeOptions options)
public static Output<GetMongoDbUserResult> getMongoDbUser(GetMongoDbUserArgs args, InvokeOptions options)
fn::invoke:
  function: ovh:CloudProject/getMongoDbUser:getMongoDbUser
  arguments:
    # arguments dictionaryThe following arguments are supported:
- ClusterId string
- Cluster ID
- Name string
- Name of the user with the authentication database in the format name@authDB, for example: johndoe@admin
- ServiceName string
- The id of the public cloud project. If omitted,
the OVH_CLOUD_PROJECT_SERVICEenvironment variable is used.
- ClusterId string
- Cluster ID
- Name string
- Name of the user with the authentication database in the format name@authDB, for example: johndoe@admin
- ServiceName string
- The id of the public cloud project. If omitted,
the OVH_CLOUD_PROJECT_SERVICEenvironment variable is used.
- clusterId String
- Cluster ID
- name String
- Name of the user with the authentication database in the format name@authDB, for example: johndoe@admin
- serviceName String
- The id of the public cloud project. If omitted,
the OVH_CLOUD_PROJECT_SERVICEenvironment variable is used.
- clusterId string
- Cluster ID
- name string
- Name of the user with the authentication database in the format name@authDB, for example: johndoe@admin
- serviceName string
- The id of the public cloud project. If omitted,
the OVH_CLOUD_PROJECT_SERVICEenvironment variable is used.
- cluster_id str
- Cluster ID
- name str
- Name of the user with the authentication database in the format name@authDB, for example: johndoe@admin
- service_name str
- The id of the public cloud project. If omitted,
the OVH_CLOUD_PROJECT_SERVICEenvironment variable is used.
- clusterId String
- Cluster ID
- name String
- Name of the user with the authentication database in the format name@authDB, for example: johndoe@admin
- serviceName String
- The id of the public cloud project. If omitted,
the OVH_CLOUD_PROJECT_SERVICEenvironment variable is used.
getMongoDbUser Result
The following output properties are available:
- ClusterId string
- See Argument Reference above.
- CreatedAt string
- Date of the creation of the user.
- Id string
- The provider-assigned unique ID for this managed resource.
- Name string
- See Argument Reference above.
- Roles List<string>
- Roles the user belongs to
- ServiceName string
- Current status of the user.
- Status string
- Current status of the user.
- ClusterId string
- See Argument Reference above.
- CreatedAt string
- Date of the creation of the user.
- Id string
- The provider-assigned unique ID for this managed resource.
- Name string
- See Argument Reference above.
- Roles []string
- Roles the user belongs to
- ServiceName string
- Current status of the user.
- Status string
- Current status of the user.
- clusterId String
- See Argument Reference above.
- createdAt String
- Date of the creation of the user.
- id String
- The provider-assigned unique ID for this managed resource.
- name String
- See Argument Reference above.
- roles List<String>
- Roles the user belongs to
- serviceName String
- Current status of the user.
- status String
- Current status of the user.
- clusterId string
- See Argument Reference above.
- createdAt string
- Date of the creation of the user.
- id string
- The provider-assigned unique ID for this managed resource.
- name string
- See Argument Reference above.
- roles string[]
- Roles the user belongs to
- serviceName string
- Current status of the user.
- status string
- Current status of the user.
- cluster_id str
- See Argument Reference above.
- created_at str
- Date of the creation of the user.
- id str
- The provider-assigned unique ID for this managed resource.
- name str
- See Argument Reference above.
- roles Sequence[str]
- Roles the user belongs to
- service_name str
- Current status of the user.
- status str
- Current status of the user.
- clusterId String
- See Argument Reference above.
- createdAt String
- Date of the creation of the user.
- id String
- The provider-assigned unique ID for this managed resource.
- name String
- See Argument Reference above.
- roles List<String>
- Roles the user belongs to
- serviceName String
- Current status of the user.
- status String
- Current status of the user.
Package Details
- Repository
- ovh ovh/pulumi-ovh
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the ovhTerraform Provider.