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

tencentcloud.getMongodbInstances

Explore with Pulumi AI

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",
});
Copy
import pulumi
import pulumi_tencentcloud as tencentcloud

mongodb = tencentcloud.get_mongodb_instances(cluster_type="REPLSET",
    instance_id="cmgo-l6lwdsel")
Copy
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
	})
}
Copy
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",
    });

});
Copy
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());

    }
}
Copy
variables:
  mongodb:
    fn::invoke:
      function: tencentcloud:getMongodbInstances
      arguments:
        clusterType: REPLSET
        instanceId: cmgo-l6lwdsel
Copy

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>
Copy
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]
Copy
func GetMongodbInstances(ctx *Context, args *GetMongodbInstancesArgs, opts ...InvokeOption) (*GetMongodbInstancesResult, error)
func GetMongodbInstancesOutput(ctx *Context, args *GetMongodbInstancesOutputArgs, opts ...InvokeOption) GetMongodbInstancesResultOutput
Copy

> 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)
}
Copy
public static CompletableFuture<GetMongodbInstancesResult> getMongodbInstances(GetMongodbInstancesArgs args, InvokeOptions options)
public static Output<GetMongodbInstancesResult> getMongodbInstances(GetMongodbInstancesArgs args, InvokeOptions options)
Copy
fn::invoke:
  function: tencentcloud:index/getMongodbInstances:getMongodbInstances
  arguments:
    # arguments dictionary
Copy

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