1. Packages
  2. Tencentcloud Provider
  3. API Docs
  4. getMongodbInstances
tencentcloud 1.81.189 published on Wednesday, Apr 30, 2025 by tencentcloudstack

tencentcloud.getMongodbInstances

Explore with Pulumi AI

tencentcloud logo
tencentcloud 1.81.189 published on Wednesday, Apr 30, 2025 by tencentcloudstack

    Use this data source to query detailed information of Mongodb instances.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as tencentcloud from "@pulumi/tencentcloud";
    
    const mongodb = tencentcloud.getMongodbInstances({
        clusterType: "REPLSET",
        instanceId: "cmgo-l6lwdsel",
    });
    
    import pulumi
    import pulumi_tencentcloud as tencentcloud
    
    mongodb = tencentcloud.get_mongodb_instances(cluster_type="REPLSET",
        instance_id="cmgo-l6lwdsel")
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-terraform-provider/sdks/go/tencentcloud/tencentcloud"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := tencentcloud.GetMongodbInstances(ctx, &tencentcloud.GetMongodbInstancesArgs{
    			ClusterType: pulumi.StringRef("REPLSET"),
    			InstanceId:  pulumi.StringRef("cmgo-l6lwdsel"),
    		}, nil)
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Tencentcloud = Pulumi.Tencentcloud;
    
    return await Deployment.RunAsync(() => 
    {
        var mongodb = Tencentcloud.GetMongodbInstances.Invoke(new()
        {
            ClusterType = "REPLSET",
            InstanceId = "cmgo-l6lwdsel",
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.tencentcloud.TencentcloudFunctions;
    import com.pulumi.tencentcloud.inputs.GetMongodbInstancesArgs;
    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 mongodb = TencentcloudFunctions.getMongodbInstances(GetMongodbInstancesArgs.builder()
                .clusterType("REPLSET")
                .instanceId("cmgo-l6lwdsel")
                .build());
    
        }
    }
    
    variables:
      mongodb:
        fn::invoke:
          function: tencentcloud:getMongodbInstances
          arguments:
            clusterType: REPLSET
            instanceId: cmgo-l6lwdsel
    

    Using getMongodbInstances

    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 getMongodbInstances(args: GetMongodbInstancesArgs, opts?: InvokeOptions): Promise<GetMongodbInstancesResult>
    function getMongodbInstancesOutput(args: GetMongodbInstancesOutputArgs, opts?: InvokeOptions): Output<GetMongodbInstancesResult>
    def get_mongodb_instances(cluster_type: Optional[str] = None,
                              id: Optional[str] = None,
                              instance_id: Optional[str] = None,
                              instance_name_prefix: Optional[str] = None,
                              result_output_file: Optional[str] = None,
                              tags: Optional[Mapping[str, str]] = None,
                              opts: Optional[InvokeOptions] = None) -> GetMongodbInstancesResult
    def get_mongodb_instances_output(cluster_type: Optional[pulumi.Input[str]] = None,
                              id: Optional[pulumi.Input[str]] = None,
                              instance_id: Optional[pulumi.Input[str]] = None,
                              instance_name_prefix: Optional[pulumi.Input[str]] = None,
                              result_output_file: Optional[pulumi.Input[str]] = None,
                              tags: Optional[pulumi.Input[Mapping[str, pulumi.Input[str]]]] = None,
                              opts: Optional[InvokeOptions] = None) -> Output[GetMongodbInstancesResult]
    func GetMongodbInstances(ctx *Context, args *GetMongodbInstancesArgs, opts ...InvokeOption) (*GetMongodbInstancesResult, error)
    func GetMongodbInstancesOutput(ctx *Context, args *GetMongodbInstancesOutputArgs, opts ...InvokeOption) GetMongodbInstancesResultOutput

    > Note: This function is named GetMongodbInstances in the Go SDK.

    public static class GetMongodbInstances 
    {
        public static Task<GetMongodbInstancesResult> InvokeAsync(GetMongodbInstancesArgs args, InvokeOptions? opts = null)
        public static Output<GetMongodbInstancesResult> Invoke(GetMongodbInstancesInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetMongodbInstancesResult> getMongodbInstances(GetMongodbInstancesArgs args, InvokeOptions options)
    public static Output<GetMongodbInstancesResult> getMongodbInstances(GetMongodbInstancesArgs args, InvokeOptions options)
    
    fn::invoke:
      function: tencentcloud:index/getMongodbInstances:getMongodbInstances
      arguments:
        # arguments dictionary

    The following arguments are supported:

    ClusterType string
    Type of Mongodb cluster, and available values include replica set cluster(expressed with REPLSET), sharding cluster(expressed with SHARD).
    Id string
    InstanceId string
    ID of the Mongodb instance to be queried.
    InstanceNamePrefix string
    Name prefix of the Mongodb instance.
    ResultOutputFile string
    Used to store results.
    Tags Dictionary<string, string>
    Tags of the Mongodb instance to be queried.
    ClusterType string
    Type of Mongodb cluster, and available values include replica set cluster(expressed with REPLSET), sharding cluster(expressed with SHARD).
    Id string
    InstanceId string
    ID of the Mongodb instance to be queried.
    InstanceNamePrefix string
    Name prefix of the Mongodb instance.
    ResultOutputFile string
    Used to store results.
    Tags map[string]string
    Tags of the Mongodb instance to be queried.
    clusterType String
    Type of Mongodb cluster, and available values include replica set cluster(expressed with REPLSET), sharding cluster(expressed with SHARD).
    id String
    instanceId String
    ID of the Mongodb instance to be queried.
    instanceNamePrefix String
    Name prefix of the Mongodb instance.
    resultOutputFile String
    Used to store results.
    tags Map<String,String>
    Tags of the Mongodb instance to be queried.
    clusterType string
    Type of Mongodb cluster, and available values include replica set cluster(expressed with REPLSET), sharding cluster(expressed with SHARD).
    id string
    instanceId string
    ID of the Mongodb instance to be queried.
    instanceNamePrefix string
    Name prefix of the Mongodb instance.
    resultOutputFile string
    Used to store results.
    tags {[key: string]: string}
    Tags of the Mongodb instance to be queried.
    cluster_type str
    Type of Mongodb cluster, and available values include replica set cluster(expressed with REPLSET), sharding cluster(expressed with SHARD).
    id str
    instance_id str
    ID of the Mongodb instance to be queried.
    instance_name_prefix str
    Name prefix of the Mongodb instance.
    result_output_file str
    Used to store results.
    tags Mapping[str, str]
    Tags of the Mongodb instance to be queried.
    clusterType String
    Type of Mongodb cluster, and available values include replica set cluster(expressed with REPLSET), sharding cluster(expressed with SHARD).
    id String
    instanceId String
    ID of the Mongodb instance to be queried.
    instanceNamePrefix String
    Name prefix of the Mongodb instance.
    resultOutputFile String
    Used to store results.
    tags Map<String>
    Tags of the Mongodb instance to be queried.

    getMongodbInstances Result

    The following output properties are available:

    Id string
    InstanceLists List<GetMongodbInstancesInstanceList>
    A list of instances. Each element contains the following attributes:
    ClusterType string
    Type of Mongodb cluster.
    InstanceId string
    ID of the Mongodb instance.
    InstanceNamePrefix string
    ResultOutputFile string
    Tags Dictionary<string, string>
    Tags of the Mongodb instance.
    Id string
    InstanceLists []GetMongodbInstancesInstanceList
    A list of instances. Each element contains the following attributes:
    ClusterType string
    Type of Mongodb cluster.
    InstanceId string
    ID of the Mongodb instance.
    InstanceNamePrefix string
    ResultOutputFile string
    Tags map[string]string
    Tags of the Mongodb instance.
    id String
    instanceLists List<GetMongodbInstancesInstanceList>
    A list of instances. Each element contains the following attributes:
    clusterType String
    Type of Mongodb cluster.
    instanceId String
    ID of the Mongodb instance.
    instanceNamePrefix String
    resultOutputFile String
    tags Map<String,String>
    Tags of the Mongodb instance.
    id string
    instanceLists GetMongodbInstancesInstanceList[]
    A list of instances. Each element contains the following attributes:
    clusterType string
    Type of Mongodb cluster.
    instanceId string
    ID of the Mongodb instance.
    instanceNamePrefix string
    resultOutputFile string
    tags {[key: string]: string}
    Tags of the Mongodb instance.
    id str
    instance_lists Sequence[GetMongodbInstancesInstanceList]
    A list of instances. Each element contains the following attributes:
    cluster_type str
    Type of Mongodb cluster.
    instance_id str
    ID of the Mongodb instance.
    instance_name_prefix str
    result_output_file str
    tags Mapping[str, str]
    Tags of the Mongodb instance.
    id String
    instanceLists List<Property Map>
    A list of instances. Each element contains the following attributes:
    clusterType String
    Type of Mongodb cluster.
    instanceId String
    ID of the Mongodb instance.
    instanceNamePrefix String
    resultOutputFile String
    tags Map<String>
    Tags of the Mongodb instance.

    Supporting Types

    GetMongodbInstancesInstanceList

    AutoRenewFlag double
    Auto renew flag.
    AvailableZone string
    The available zone of the Mongodb.
    ChargeType string
    The charge type of instance.
    ClusterType string
    Type of Mongodb cluster, and available values include replica set cluster(expressed with REPLSET), sharding cluster(expressed with SHARD).
    Cpu double
    Number of cpu's core.
    CreateTime string
    Creation time of the Mongodb instance.
    EngineVersion string
    Version of the Mongodb engine.
    InstanceId string
    ID of the Mongodb instance to be queried.
    InstanceName string
    Name of the Mongodb instance.
    MachineType string
    Type of Mongodb instance.
    Memory double
    Memory size.
    ProjectId double
    ID of the project which the instance belongs.
    ShardQuantity double
    Number of sharding.
    Status double
    Status of the Mongodb, and available values include pending initialization(expressed with 0), processing(expressed with 1), running(expressed with 2) and expired(expressed with -2).
    SubnetId string
    ID of the subnet.
    Tags Dictionary<string, string>
    Tags of the Mongodb instance to be queried.
    Vip string
    IP of the Mongodb instance.
    Volume double
    Disk size.
    VpcId string
    ID of the VPC.
    Vport double
    IP port of the Mongodb instance.
    AutoRenewFlag float64
    Auto renew flag.
    AvailableZone string
    The available zone of the Mongodb.
    ChargeType string
    The charge type of instance.
    ClusterType string
    Type of Mongodb cluster, and available values include replica set cluster(expressed with REPLSET), sharding cluster(expressed with SHARD).
    Cpu float64
    Number of cpu's core.
    CreateTime string
    Creation time of the Mongodb instance.
    EngineVersion string
    Version of the Mongodb engine.
    InstanceId string
    ID of the Mongodb instance to be queried.
    InstanceName string
    Name of the Mongodb instance.
    MachineType string
    Type of Mongodb instance.
    Memory float64
    Memory size.
    ProjectId float64
    ID of the project which the instance belongs.
    ShardQuantity float64
    Number of sharding.
    Status float64
    Status of the Mongodb, and available values include pending initialization(expressed with 0), processing(expressed with 1), running(expressed with 2) and expired(expressed with -2).
    SubnetId string
    ID of the subnet.
    Tags map[string]string
    Tags of the Mongodb instance to be queried.
    Vip string
    IP of the Mongodb instance.
    Volume float64
    Disk size.
    VpcId string
    ID of the VPC.
    Vport float64
    IP port of the Mongodb instance.
    autoRenewFlag Double
    Auto renew flag.
    availableZone String
    The available zone of the Mongodb.
    chargeType String
    The charge type of instance.
    clusterType String
    Type of Mongodb cluster, and available values include replica set cluster(expressed with REPLSET), sharding cluster(expressed with SHARD).
    cpu Double
    Number of cpu's core.
    createTime String
    Creation time of the Mongodb instance.
    engineVersion String
    Version of the Mongodb engine.
    instanceId String
    ID of the Mongodb instance to be queried.
    instanceName String
    Name of the Mongodb instance.
    machineType String
    Type of Mongodb instance.
    memory Double
    Memory size.
    projectId Double
    ID of the project which the instance belongs.
    shardQuantity Double
    Number of sharding.
    status Double
    Status of the Mongodb, and available values include pending initialization(expressed with 0), processing(expressed with 1), running(expressed with 2) and expired(expressed with -2).
    subnetId String
    ID of the subnet.
    tags Map<String,String>
    Tags of the Mongodb instance to be queried.
    vip String
    IP of the Mongodb instance.
    volume Double
    Disk size.
    vpcId String
    ID of the VPC.
    vport Double
    IP port of the Mongodb instance.
    autoRenewFlag number
    Auto renew flag.
    availableZone string
    The available zone of the Mongodb.
    chargeType string
    The charge type of instance.
    clusterType string
    Type of Mongodb cluster, and available values include replica set cluster(expressed with REPLSET), sharding cluster(expressed with SHARD).
    cpu number
    Number of cpu's core.
    createTime string
    Creation time of the Mongodb instance.
    engineVersion string
    Version of the Mongodb engine.
    instanceId string
    ID of the Mongodb instance to be queried.
    instanceName string
    Name of the Mongodb instance.
    machineType string
    Type of Mongodb instance.
    memory number
    Memory size.
    projectId number
    ID of the project which the instance belongs.
    shardQuantity number
    Number of sharding.
    status number
    Status of the Mongodb, and available values include pending initialization(expressed with 0), processing(expressed with 1), running(expressed with 2) and expired(expressed with -2).
    subnetId string
    ID of the subnet.
    tags {[key: string]: string}
    Tags of the Mongodb instance to be queried.
    vip string
    IP of the Mongodb instance.
    volume number
    Disk size.
    vpcId string
    ID of the VPC.
    vport number
    IP port of the Mongodb instance.
    auto_renew_flag float
    Auto renew flag.
    available_zone str
    The available zone of the Mongodb.
    charge_type str
    The charge type of instance.
    cluster_type str
    Type of Mongodb cluster, and available values include replica set cluster(expressed with REPLSET), sharding cluster(expressed with SHARD).
    cpu float
    Number of cpu's core.
    create_time str
    Creation time of the Mongodb instance.
    engine_version str
    Version of the Mongodb engine.
    instance_id str
    ID of the Mongodb instance to be queried.
    instance_name str
    Name of the Mongodb instance.
    machine_type str
    Type of Mongodb instance.
    memory float
    Memory size.
    project_id float
    ID of the project which the instance belongs.
    shard_quantity float
    Number of sharding.
    status float
    Status of the Mongodb, and available values include pending initialization(expressed with 0), processing(expressed with 1), running(expressed with 2) and expired(expressed with -2).
    subnet_id str
    ID of the subnet.
    tags Mapping[str, str]
    Tags of the Mongodb instance to be queried.
    vip str
    IP of the Mongodb instance.
    volume float
    Disk size.
    vpc_id str
    ID of the VPC.
    vport float
    IP port of the Mongodb instance.
    autoRenewFlag Number
    Auto renew flag.
    availableZone String
    The available zone of the Mongodb.
    chargeType String
    The charge type of instance.
    clusterType String
    Type of Mongodb cluster, and available values include replica set cluster(expressed with REPLSET), sharding cluster(expressed with SHARD).
    cpu Number
    Number of cpu's core.
    createTime String
    Creation time of the Mongodb instance.
    engineVersion String
    Version of the Mongodb engine.
    instanceId String
    ID of the Mongodb instance to be queried.
    instanceName String
    Name of the Mongodb instance.
    machineType String
    Type of Mongodb instance.
    memory Number
    Memory size.
    projectId Number
    ID of the project which the instance belongs.
    shardQuantity Number
    Number of sharding.
    status Number
    Status of the Mongodb, and available values include pending initialization(expressed with 0), processing(expressed with 1), running(expressed with 2) and expired(expressed with -2).
    subnetId String
    ID of the subnet.
    tags Map<String>
    Tags of the Mongodb instance to be queried.
    vip String
    IP of the Mongodb instance.
    volume Number
    Disk size.
    vpcId String
    ID of the VPC.
    vport Number
    IP port of the Mongodb instance.

    Package Details

    Repository
    tencentcloud tencentcloudstack/terraform-provider-tencentcloud
    License
    Notes
    This Pulumi package is based on the tencentcloud Terraform Provider.
    tencentcloud logo
    tencentcloud 1.81.189 published on Wednesday, Apr 30, 2025 by tencentcloudstack