Alibaba Cloud v3.75.0 published on Friday, Mar 7, 2025 by Pulumi
alicloud.mongodb.getInstances
Explore with Pulumi AI
The alicloud.mongodb.getInstances data source provides a collection of MongoDB instances available in Alicloud account.
Filters support regular expression for the instance name, engine or instance type.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as alicloud from "@pulumi/alicloud";
const mongo = alicloud.mongodb.getInstances({
    nameRegex: "dds-.+\\d+",
    instanceType: "replicate",
    instanceClass: "dds.mongo.mid",
    availabilityZone: "eu-central-1a",
});
import pulumi
import pulumi_alicloud as alicloud
mongo = alicloud.mongodb.get_instances(name_regex="dds-.+\\d+",
    instance_type="replicate",
    instance_class="dds.mongo.mid",
    availability_zone="eu-central-1a")
package main
import (
	"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/mongodb"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := mongodb.GetInstances(ctx, &mongodb.GetInstancesArgs{
			NameRegex:        pulumi.StringRef("dds-.+\\d+"),
			InstanceType:     pulumi.StringRef("replicate"),
			InstanceClass:    pulumi.StringRef("dds.mongo.mid"),
			AvailabilityZone: pulumi.StringRef("eu-central-1a"),
		}, nil)
		if err != nil {
			return err
		}
		return nil
	})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AliCloud = Pulumi.AliCloud;
return await Deployment.RunAsync(() => 
{
    var mongo = AliCloud.MongoDB.GetInstances.Invoke(new()
    {
        NameRegex = "dds-.+\\d+",
        InstanceType = "replicate",
        InstanceClass = "dds.mongo.mid",
        AvailabilityZone = "eu-central-1a",
    });
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.alicloud.mongodb.MongodbFunctions;
import com.pulumi.alicloud.mongodb.inputs.GetInstancesArgs;
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 mongo = MongodbFunctions.getInstances(GetInstancesArgs.builder()
            .nameRegex("dds-.+\\d+")
            .instanceType("replicate")
            .instanceClass("dds.mongo.mid")
            .availabilityZone("eu-central-1a")
            .build());
    }
}
variables:
  mongo:
    fn::invoke:
      function: alicloud:mongodb:getInstances
      arguments:
        nameRegex: dds-.+\d+
        instanceType: replicate
        instanceClass: dds.mongo.mid
        availabilityZone: eu-central-1a
Using getInstances
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 getInstances(args: GetInstancesArgs, opts?: InvokeOptions): Promise<GetInstancesResult>
function getInstancesOutput(args: GetInstancesOutputArgs, opts?: InvokeOptions): Output<GetInstancesResult>def get_instances(availability_zone: Optional[str] = None,
                  ids: Optional[Sequence[str]] = None,
                  instance_class: Optional[str] = None,
                  instance_type: Optional[str] = None,
                  name_regex: Optional[str] = None,
                  output_file: Optional[str] = None,
                  tags: Optional[Mapping[str, str]] = None,
                  opts: Optional[InvokeOptions] = None) -> GetInstancesResult
def get_instances_output(availability_zone: Optional[pulumi.Input[str]] = None,
                  ids: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
                  instance_class: Optional[pulumi.Input[str]] = None,
                  instance_type: Optional[pulumi.Input[str]] = None,
                  name_regex: Optional[pulumi.Input[str]] = None,
                  output_file: Optional[pulumi.Input[str]] = None,
                  tags: Optional[pulumi.Input[Mapping[str, pulumi.Input[str]]]] = None,
                  opts: Optional[InvokeOptions] = None) -> Output[GetInstancesResult]func GetInstances(ctx *Context, args *GetInstancesArgs, opts ...InvokeOption) (*GetInstancesResult, error)
func GetInstancesOutput(ctx *Context, args *GetInstancesOutputArgs, opts ...InvokeOption) GetInstancesResultOutput> Note: This function is named GetInstances in the Go SDK.
public static class GetInstances 
{
    public static Task<GetInstancesResult> InvokeAsync(GetInstancesArgs args, InvokeOptions? opts = null)
    public static Output<GetInstancesResult> Invoke(GetInstancesInvokeArgs args, InvokeOptions? opts = null)
}public static CompletableFuture<GetInstancesResult> getInstances(GetInstancesArgs args, InvokeOptions options)
public static Output<GetInstancesResult> getInstances(GetInstancesArgs args, InvokeOptions options)
fn::invoke:
  function: alicloud:mongodb/getInstances:getInstances
  arguments:
    # arguments dictionaryThe following arguments are supported:
- AvailabilityZone string
- Instance availability zone.
- Ids List<string>
- The ids list of MongoDB instances
- InstanceClass string
- Sizing of the instance to be queried.
- InstanceType string
- Type of the instance to be queried. If it is set to sharding, the sharded cluster instances are listed. If it is set toreplicate, replica set instances are listed. Default valuereplicate.
- NameRegex string
- A regex string to apply to the instance name.
- OutputFile string
- The name of file that can save the collection of instances after running pulumi preview.
- Dictionary<string, string>
- A mapping of tags to assign to the resource.
- AvailabilityZone string
- Instance availability zone.
- Ids []string
- The ids list of MongoDB instances
- InstanceClass string
- Sizing of the instance to be queried.
- InstanceType string
- Type of the instance to be queried. If it is set to sharding, the sharded cluster instances are listed. If it is set toreplicate, replica set instances are listed. Default valuereplicate.
- NameRegex string
- A regex string to apply to the instance name.
- OutputFile string
- The name of file that can save the collection of instances after running pulumi preview.
- map[string]string
- A mapping of tags to assign to the resource.
- availabilityZone String
- Instance availability zone.
- ids List<String>
- The ids list of MongoDB instances
- instanceClass String
- Sizing of the instance to be queried.
- instanceType String
- Type of the instance to be queried. If it is set to sharding, the sharded cluster instances are listed. If it is set toreplicate, replica set instances are listed. Default valuereplicate.
- nameRegex String
- A regex string to apply to the instance name.
- outputFile String
- The name of file that can save the collection of instances after running pulumi preview.
- Map<String,String>
- A mapping of tags to assign to the resource.
- availabilityZone string
- Instance availability zone.
- ids string[]
- The ids list of MongoDB instances
- instanceClass string
- Sizing of the instance to be queried.
- instanceType string
- Type of the instance to be queried. If it is set to sharding, the sharded cluster instances are listed. If it is set toreplicate, replica set instances are listed. Default valuereplicate.
- nameRegex string
- A regex string to apply to the instance name.
- outputFile string
- The name of file that can save the collection of instances after running pulumi preview.
- {[key: string]: string}
- A mapping of tags to assign to the resource.
- availability_zone str
- Instance availability zone.
- ids Sequence[str]
- The ids list of MongoDB instances
- instance_class str
- Sizing of the instance to be queried.
- instance_type str
- Type of the instance to be queried. If it is set to sharding, the sharded cluster instances are listed. If it is set toreplicate, replica set instances are listed. Default valuereplicate.
- name_regex str
- A regex string to apply to the instance name.
- output_file str
- The name of file that can save the collection of instances after running pulumi preview.
- Mapping[str, str]
- A mapping of tags to assign to the resource.
- availabilityZone String
- Instance availability zone.
- ids List<String>
- The ids list of MongoDB instances
- instanceClass String
- Sizing of the instance to be queried.
- instanceType String
- Type of the instance to be queried. If it is set to sharding, the sharded cluster instances are listed. If it is set toreplicate, replica set instances are listed. Default valuereplicate.
- nameRegex String
- A regex string to apply to the instance name.
- outputFile String
- The name of file that can save the collection of instances after running pulumi preview.
- Map<String>
- A mapping of tags to assign to the resource.
getInstances Result
The following output properties are available:
- Id string
- The provider-assigned unique ID for this managed resource.
- Ids List<string>
- The ids list of MongoDB instances
- Instances
List<Pulumi.Ali Cloud. Mongo DB. Outputs. Get Instances Instance> 
- A list of MongoDB instances. Its every element contains the following attributes:
- Names List<string>
- The names list of MongoDB instances
- AvailabilityZone string
- Instance availability zone.
- InstanceClass string
- Sizing of the MongoDB instance.
- InstanceType string
- Instance type. Optional values shardingorreplicate.
- NameRegex string
- OutputFile string
- Dictionary<string, string>
- Id string
- The provider-assigned unique ID for this managed resource.
- Ids []string
- The ids list of MongoDB instances
- Instances
[]GetInstances Instance 
- A list of MongoDB instances. Its every element contains the following attributes:
- Names []string
- The names list of MongoDB instances
- AvailabilityZone string
- Instance availability zone.
- InstanceClass string
- Sizing of the MongoDB instance.
- InstanceType string
- Instance type. Optional values shardingorreplicate.
- NameRegex string
- OutputFile string
- map[string]string
- id String
- The provider-assigned unique ID for this managed resource.
- ids List<String>
- The ids list of MongoDB instances
- instances
List<GetInstances Instance> 
- A list of MongoDB instances. Its every element contains the following attributes:
- names List<String>
- The names list of MongoDB instances
- availabilityZone String
- Instance availability zone.
- instanceClass String
- Sizing of the MongoDB instance.
- instanceType String
- Instance type. Optional values shardingorreplicate.
- nameRegex String
- outputFile String
- Map<String,String>
- id string
- The provider-assigned unique ID for this managed resource.
- ids string[]
- The ids list of MongoDB instances
- instances
GetInstances Instance[] 
- A list of MongoDB instances. Its every element contains the following attributes:
- names string[]
- The names list of MongoDB instances
- availabilityZone string
- Instance availability zone.
- instanceClass string
- Sizing of the MongoDB instance.
- instanceType string
- Instance type. Optional values shardingorreplicate.
- nameRegex string
- outputFile string
- {[key: string]: string}
- id str
- The provider-assigned unique ID for this managed resource.
- ids Sequence[str]
- The ids list of MongoDB instances
- instances
Sequence[GetInstances Instance] 
- A list of MongoDB instances. Its every element contains the following attributes:
- names Sequence[str]
- The names list of MongoDB instances
- availability_zone str
- Instance availability zone.
- instance_class str
- Sizing of the MongoDB instance.
- instance_type str
- Instance type. Optional values shardingorreplicate.
- name_regex str
- output_file str
- Mapping[str, str]
- id String
- The provider-assigned unique ID for this managed resource.
- ids List<String>
- The ids list of MongoDB instances
- instances List<Property Map>
- A list of MongoDB instances. Its every element contains the following attributes:
- names List<String>
- The names list of MongoDB instances
- availabilityZone String
- Instance availability zone.
- instanceClass String
- Sizing of the MongoDB instance.
- instanceType String
- Instance type. Optional values shardingorreplicate.
- nameRegex String
- outputFile String
- Map<String>
Supporting Types
GetInstancesInstance  
- AvailabilityZone string
- Instance availability zone.
- ChargeType string
- Billing method. Value options are PostPaidfor Pay-As-You-Go andPrePaidfor yearly or monthly subscription.
- CreationTime string
- Creation time of the instance in RFC3339 format.
- Engine string
- Database engine type. Supported option is MongoDB.
- EngineVersion string
- Database engine version.
- ExpirationTime string
- Expiration time in RFC3339 format. Pay-As-You-Go instances are never expire.
- Id string
- The ID of the MongoDB instance.
- InstanceClass string
- Sizing of the instance to be queried.
- InstanceType string
- Type of the instance to be queried. If it is set to sharding, the sharded cluster instances are listed. If it is set toreplicate, replica set instances are listed. Default valuereplicate.
- LockMode string
- Lock status of the instance.
- Mongos
List<Pulumi.Ali Cloud. Mongo DB. Inputs. Get Instances Instance Mongo> 
- Array composed of Mongos.
- Name string
- The name of the MongoDB instance.
- NetworkType string
- Classic network or VPC.
- RegionId string
- Region ID the instance belongs to.
- Replication string
- Replication factor corresponds to number of nodes. Optional values are 1for single node and3for three nodes replica set.
- 
List<Pulumi.Ali Cloud. Mongo DB. Inputs. Get Instances Instance Shard> 
- Array composed of shards.
- Status string
- Status of the instance.
- Storage int
- Shard disk.
- Dictionary<string, string>
- A mapping of tags to assign to the resource.
- AvailabilityZone string
- Instance availability zone.
- ChargeType string
- Billing method. Value options are PostPaidfor Pay-As-You-Go andPrePaidfor yearly or monthly subscription.
- CreationTime string
- Creation time of the instance in RFC3339 format.
- Engine string
- Database engine type. Supported option is MongoDB.
- EngineVersion string
- Database engine version.
- ExpirationTime string
- Expiration time in RFC3339 format. Pay-As-You-Go instances are never expire.
- Id string
- The ID of the MongoDB instance.
- InstanceClass string
- Sizing of the instance to be queried.
- InstanceType string
- Type of the instance to be queried. If it is set to sharding, the sharded cluster instances are listed. If it is set toreplicate, replica set instances are listed. Default valuereplicate.
- LockMode string
- Lock status of the instance.
- Mongos
[]GetInstances Instance Mongo 
- Array composed of Mongos.
- Name string
- The name of the MongoDB instance.
- NetworkType string
- Classic network or VPC.
- RegionId string
- Region ID the instance belongs to.
- Replication string
- Replication factor corresponds to number of nodes. Optional values are 1for single node and3for three nodes replica set.
- 
[]GetInstances Instance Shard 
- Array composed of shards.
- Status string
- Status of the instance.
- Storage int
- Shard disk.
- map[string]string
- A mapping of tags to assign to the resource.
- availabilityZone String
- Instance availability zone.
- chargeType String
- Billing method. Value options are PostPaidfor Pay-As-You-Go andPrePaidfor yearly or monthly subscription.
- creationTime String
- Creation time of the instance in RFC3339 format.
- engine String
- Database engine type. Supported option is MongoDB.
- engineVersion String
- Database engine version.
- expirationTime String
- Expiration time in RFC3339 format. Pay-As-You-Go instances are never expire.
- id String
- The ID of the MongoDB instance.
- instanceClass String
- Sizing of the instance to be queried.
- instanceType String
- Type of the instance to be queried. If it is set to sharding, the sharded cluster instances are listed. If it is set toreplicate, replica set instances are listed. Default valuereplicate.
- lockMode String
- Lock status of the instance.
- mongos
List<GetInstances Instance Mongo> 
- Array composed of Mongos.
- name String
- The name of the MongoDB instance.
- networkType String
- Classic network or VPC.
- regionId String
- Region ID the instance belongs to.
- replication String
- Replication factor corresponds to number of nodes. Optional values are 1for single node and3for three nodes replica set.
- 
List<GetInstances Instance Shard> 
- Array composed of shards.
- status String
- Status of the instance.
- storage Integer
- Shard disk.
- Map<String,String>
- A mapping of tags to assign to the resource.
- availabilityZone string
- Instance availability zone.
- chargeType string
- Billing method. Value options are PostPaidfor Pay-As-You-Go andPrePaidfor yearly or monthly subscription.
- creationTime string
- Creation time of the instance in RFC3339 format.
- engine string
- Database engine type. Supported option is MongoDB.
- engineVersion string
- Database engine version.
- expirationTime string
- Expiration time in RFC3339 format. Pay-As-You-Go instances are never expire.
- id string
- The ID of the MongoDB instance.
- instanceClass string
- Sizing of the instance to be queried.
- instanceType string
- Type of the instance to be queried. If it is set to sharding, the sharded cluster instances are listed. If it is set toreplicate, replica set instances are listed. Default valuereplicate.
- lockMode string
- Lock status of the instance.
- mongos
GetInstances Instance Mongo[] 
- Array composed of Mongos.
- name string
- The name of the MongoDB instance.
- networkType string
- Classic network or VPC.
- regionId string
- Region ID the instance belongs to.
- replication string
- Replication factor corresponds to number of nodes. Optional values are 1for single node and3for three nodes replica set.
- 
GetInstances Instance Shard[] 
- Array composed of shards.
- status string
- Status of the instance.
- storage number
- Shard disk.
- {[key: string]: string}
- A mapping of tags to assign to the resource.
- availability_zone str
- Instance availability zone.
- charge_type str
- Billing method. Value options are PostPaidfor Pay-As-You-Go andPrePaidfor yearly or monthly subscription.
- creation_time str
- Creation time of the instance in RFC3339 format.
- engine str
- Database engine type. Supported option is MongoDB.
- engine_version str
- Database engine version.
- expiration_time str
- Expiration time in RFC3339 format. Pay-As-You-Go instances are never expire.
- id str
- The ID of the MongoDB instance.
- instance_class str
- Sizing of the instance to be queried.
- instance_type str
- Type of the instance to be queried. If it is set to sharding, the sharded cluster instances are listed. If it is set toreplicate, replica set instances are listed. Default valuereplicate.
- lock_mode str
- Lock status of the instance.
- mongos
Sequence[GetInstances Instance Mongo] 
- Array composed of Mongos.
- name str
- The name of the MongoDB instance.
- network_type str
- Classic network or VPC.
- region_id str
- Region ID the instance belongs to.
- replication str
- Replication factor corresponds to number of nodes. Optional values are 1for single node and3for three nodes replica set.
- 
Sequence[GetInstances Instance Shard] 
- Array composed of shards.
- status str
- Status of the instance.
- storage int
- Shard disk.
- Mapping[str, str]
- A mapping of tags to assign to the resource.
- availabilityZone String
- Instance availability zone.
- chargeType String
- Billing method. Value options are PostPaidfor Pay-As-You-Go andPrePaidfor yearly or monthly subscription.
- creationTime String
- Creation time of the instance in RFC3339 format.
- engine String
- Database engine type. Supported option is MongoDB.
- engineVersion String
- Database engine version.
- expirationTime String
- Expiration time in RFC3339 format. Pay-As-You-Go instances are never expire.
- id String
- The ID of the MongoDB instance.
- instanceClass String
- Sizing of the instance to be queried.
- instanceType String
- Type of the instance to be queried. If it is set to sharding, the sharded cluster instances are listed. If it is set toreplicate, replica set instances are listed. Default valuereplicate.
- lockMode String
- Lock status of the instance.
- mongos List<Property Map>
- Array composed of Mongos.
- name String
- The name of the MongoDB instance.
- networkType String
- Classic network or VPC.
- regionId String
- Region ID the instance belongs to.
- replication String
- Replication factor corresponds to number of nodes. Optional values are 1for single node and3for three nodes replica set.
- List<Property Map>
- Array composed of shards.
- status String
- Status of the instance.
- storage Number
- Shard disk.
- Map<String>
- A mapping of tags to assign to the resource.
GetInstancesInstanceMongo   
- Class string
- Shard instance specification.
- Description string
- Shard instance description.
- NodeId string
- Shard instance ID.
- Class string
- Shard instance specification.
- Description string
- Shard instance description.
- NodeId string
- Shard instance ID.
- class_ String
- Shard instance specification.
- description String
- Shard instance description.
- nodeId String
- Shard instance ID.
- class string
- Shard instance specification.
- description string
- Shard instance description.
- nodeId string
- Shard instance ID.
- class_ str
- Shard instance specification.
- description str
- Shard instance description.
- node_id str
- Shard instance ID.
- class String
- Shard instance specification.
- description String
- Shard instance description.
- nodeId String
- Shard instance ID.
GetInstancesInstanceShard   
- Class string
- Shard instance specification.
- Description string
- Shard instance description.
- NodeId string
- Shard instance ID.
- Storage int
- Shard disk.
- Class string
- Shard instance specification.
- Description string
- Shard instance description.
- NodeId string
- Shard instance ID.
- Storage int
- Shard disk.
- class_ String
- Shard instance specification.
- description String
- Shard instance description.
- nodeId String
- Shard instance ID.
- storage Integer
- Shard disk.
- class string
- Shard instance specification.
- description string
- Shard instance description.
- nodeId string
- Shard instance ID.
- storage number
- Shard disk.
- class_ str
- Shard instance specification.
- description str
- Shard instance description.
- node_id str
- Shard instance ID.
- storage int
- Shard disk.
- class String
- Shard instance specification.
- description String
- Shard instance description.
- nodeId String
- Shard instance ID.
- storage Number
- Shard disk.
Package Details
- Repository
- Alibaba Cloud pulumi/pulumi-alicloud
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the alicloudTerraform Provider.