Alibaba Cloud
getInstances
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
using Pulumi;
using AliCloud = Pulumi.AliCloud;
class MyStack : Stack
{
public MyStack()
{
var mongo = Output.Create(AliCloud.MongoDB.GetInstances.InvokeAsync(new AliCloud.MongoDB.GetInstancesArgs
{
AvailabilityZone = "eu-central-1a",
InstanceClass = "dds.mongo.mid",
InstanceType = "replicate",
NameRegex = "dds-.+\\d+",
}));
}
}
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{
AvailabilityZone: pulumi.StringRef("eu-central-1a"),
InstanceClass: pulumi.StringRef("dds.mongo.mid"),
InstanceType: pulumi.StringRef("replicate"),
NameRegex: pulumi.StringRef("dds-.+\\d+"),
}, nil)
if err != nil {
return err
}
return nil
})
}
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.actiontrail.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()
.availabilityZone("eu-central-1a")
.instanceClass("dds.mongo.mid")
.instanceType("replicate")
.nameRegex("dds-.+\\d+")
.build());
}
}
import pulumi
import pulumi_alicloud as alicloud
mongo = alicloud.mongodb.get_instances(availability_zone="eu-central-1a",
instance_class="dds.mongo.mid",
instance_type="replicate",
name_regex="dds-.+\\d+")
import * as pulumi from "@pulumi/pulumi";
import * as alicloud from "@pulumi/alicloud";
const mongo = pulumi.output(alicloud.mongodb.getInstances({
availabilityZone: "eu-central-1a",
instanceClass: "dds.mongo.mid",
instanceType: "replicate",
nameRegex: "dds-.+\\d+",
}));
variables:
mongo:
Fn::Invoke:
Function: alicloud:mongodb:getInstances
Arguments:
availabilityZone: eu-central-1a
instanceClass: dds.mongo.mid
instanceType: replicate
nameRegex: dds-.+\d+
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, Any]] = 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, Any]]] = 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)
// Output-based functions aren't available in Java yet
Fn::Invoke:
Function: alicloud:mongodb/getInstances:getInstances
Arguments:
# Arguments dictionary
The following arguments are supported:
- Availability
Zone string Instance availability zone.
- Ids List<string>
The ids list of MongoDB instances
- Instance
Class string Sizing of the instance to be queried.
- Instance
Type 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
.- Name
Regex string A regex string to apply to the instance name.
- Output
File string - Dictionary<string, object>
A mapping of tags to assign to the resource.
- Availability
Zone string Instance availability zone.
- Ids []string
The ids list of MongoDB instances
- Instance
Class string Sizing of the instance to be queried.
- Instance
Type 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
.- Name
Regex string A regex string to apply to the instance name.
- Output
File string - map[string]interface{}
A mapping of tags to assign to the resource.
- availability
Zone String Instance availability zone.
- ids List<String>
The ids list of MongoDB instances
- instance
Class String Sizing of the instance to be queried.
- instance
Type 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
.- name
Regex String A regex string to apply to the instance name.
- output
File String - Map<String,Object>
A mapping of tags to assign to the resource.
- availability
Zone string Instance availability zone.
- ids string[]
The ids list of MongoDB instances
- instance
Class string Sizing of the instance to be queried.
- instance
Type 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
.- name
Regex string A regex string to apply to the instance name.
- output
File string - {[key: string]: any}
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 - Mapping[str, Any]
A mapping of tags to assign to the resource.
- availability
Zone String Instance availability zone.
- ids List<String>
The ids list of MongoDB instances
- instance
Class String Sizing of the instance to be queried.
- instance
Type 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
.- name
Regex String A regex string to apply to the instance name.
- output
File String - Map<Any>
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
- Availability
Zone string Instance availability zone.
- Instance
Class string Sizing of the MongoDB instance.
- Instance
Type string Instance type. Optional values
sharding
orreplicate
.- Name
Regex string - Output
File string - Dictionary<string, object>
- Id string
The provider-assigned unique ID for this managed resource.
- Ids []string
The ids list of MongoDB instances
- Instances
[]Get
Instances Instance A list of MongoDB instances. Its every element contains the following attributes:
- Names []string
The names list of MongoDB instances
- Availability
Zone string Instance availability zone.
- Instance
Class string Sizing of the MongoDB instance.
- Instance
Type string Instance type. Optional values
sharding
orreplicate
.- Name
Regex string - Output
File string - map[string]interface{}
- id String
The provider-assigned unique ID for this managed resource.
- ids List<String>
The ids list of MongoDB instances
- instances
List<Get
Instances Instance> A list of MongoDB instances. Its every element contains the following attributes:
- names List<String>
The names list of MongoDB instances
- availability
Zone String Instance availability zone.
- instance
Class String Sizing of the MongoDB instance.
- instance
Type String Instance type. Optional values
sharding
orreplicate
.- name
Regex String - output
File String - Map<String,Object>
- id string
The provider-assigned unique ID for this managed resource.
- ids string[]
The ids list of MongoDB instances
- instances
Get
Instances Instance[] A list of MongoDB instances. Its every element contains the following attributes:
- names string[]
The names list of MongoDB instances
- availability
Zone string Instance availability zone.
- instance
Class string Sizing of the MongoDB instance.
- instance
Type string Instance type. Optional values
sharding
orreplicate
.- name
Regex string - output
File string - {[key: string]: any}
- id str
The provider-assigned unique ID for this managed resource.
- ids Sequence[str]
The ids list of MongoDB instances
- instances
Sequence[Get
Instances 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
sharding
orreplicate
.- name_
regex str - output_
file str - Mapping[str, Any]
- 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
- availability
Zone String Instance availability zone.
- instance
Class String Sizing of the MongoDB instance.
- instance
Type String Instance type. Optional values
sharding
orreplicate
.- name
Regex String - output
File String - Map<Any>
Supporting Types
GetInstancesInstance
- Availability
Zone string Instance availability zone.
- Charge
Type string Billing method. Value options are
PostPaid
for Pay-As-You-Go andPrePaid
for yearly or monthly subscription.- Creation
Time string Creation time of the instance in RFC3339 format.
- Engine string
Database engine type. Supported option is
MongoDB
.- Engine
Version string Database engine version.
- Expiration
Time string Expiration time in RFC3339 format. Pay-As-You-Go instances are never expire.
- Id string
The ID of the MongoDB instance.
- Instance
Class string Sizing of the instance to be queried.
- Instance
Type 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
.- Lock
Mode 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.
- Network
Type string Classic network or VPC.
- Region
Id string Region ID the instance belongs to.
- Replication string
Replication factor corresponds to number of nodes. Optional values are
1
for single node and3
for 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, object>
A mapping of tags to assign to the resource.
- Availability
Zone string Instance availability zone.
- Charge
Type string Billing method. Value options are
PostPaid
for Pay-As-You-Go andPrePaid
for yearly or monthly subscription.- Creation
Time string Creation time of the instance in RFC3339 format.
- Engine string
Database engine type. Supported option is
MongoDB
.- Engine
Version string Database engine version.
- Expiration
Time string Expiration time in RFC3339 format. Pay-As-You-Go instances are never expire.
- Id string
The ID of the MongoDB instance.
- Instance
Class string Sizing of the instance to be queried.
- Instance
Type 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
.- Lock
Mode string Lock status of the instance.
- Mongos
[]Get
Instances Instance Mongo Array composed of Mongos.
- Name string
The name of the MongoDB instance.
- Network
Type string Classic network or VPC.
- Region
Id string Region ID the instance belongs to.
- Replication string
Replication factor corresponds to number of nodes. Optional values are
1
for single node and3
for three nodes replica set.- []Get
Instances Instance Shard Array composed of shards.
- Status string
Status of the instance.
- Storage int
Shard disk.
- map[string]interface{}
A mapping of tags to assign to the resource.
- availability
Zone String Instance availability zone.
- charge
Type String Billing method. Value options are
PostPaid
for Pay-As-You-Go andPrePaid
for yearly or monthly subscription.- creation
Time String Creation time of the instance in RFC3339 format.
- engine String
Database engine type. Supported option is
MongoDB
.- engine
Version String Database engine version.
- expiration
Time String Expiration time in RFC3339 format. Pay-As-You-Go instances are never expire.
- id String
The ID of the MongoDB instance.
- instance
Class String Sizing of the instance to be queried.
- instance
Type 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
.- lock
Mode String Lock status of the instance.
- mongos
List<Get
Instances Instance Mongo> Array composed of Mongos.
- name String
The name of the MongoDB instance.
- network
Type String Classic network or VPC.
- region
Id String Region ID the instance belongs to.
- replication String
Replication factor corresponds to number of nodes. Optional values are
1
for single node and3
for three nodes replica set.- List<Get
Instances Instance Shard> Array composed of shards.
- status String
Status of the instance.
- storage Integer
Shard disk.
- Map<String,Object>
A mapping of tags to assign to the resource.
- availability
Zone string Instance availability zone.
- charge
Type string Billing method. Value options are
PostPaid
for Pay-As-You-Go andPrePaid
for yearly or monthly subscription.- creation
Time string Creation time of the instance in RFC3339 format.
- engine string
Database engine type. Supported option is
MongoDB
.- engine
Version string Database engine version.
- expiration
Time string Expiration time in RFC3339 format. Pay-As-You-Go instances are never expire.
- id string
The ID of the MongoDB instance.
- instance
Class string Sizing of the instance to be queried.
- instance
Type 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
.- lock
Mode string Lock status of the instance.
- mongos
Get
Instances Instance Mongo[] Array composed of Mongos.
- name string
The name of the MongoDB instance.
- network
Type string Classic network or VPC.
- region
Id string Region ID the instance belongs to.
- replication string
Replication factor corresponds to number of nodes. Optional values are
1
for single node and3
for three nodes replica set.- Get
Instances Instance Shard[] Array composed of shards.
- status string
Status of the instance.
- storage number
Shard disk.
- {[key: string]: any}
A mapping of tags to assign to the resource.
- availability_
zone str Instance availability zone.
- charge_
type str Billing method. Value options are
PostPaid
for Pay-As-You-Go andPrePaid
for 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[Get
Instances 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
1
for single node and3
for three nodes replica set.- Sequence[Get
Instances Instance Shard] Array composed of shards.
- status str
Status of the instance.
- storage int
Shard disk.
- Mapping[str, Any]
A mapping of tags to assign to the resource.
- availability
Zone String Instance availability zone.
- charge
Type String Billing method. Value options are
PostPaid
for Pay-As-You-Go andPrePaid
for yearly or monthly subscription.- creation
Time String Creation time of the instance in RFC3339 format.
- engine String
Database engine type. Supported option is
MongoDB
.- engine
Version String Database engine version.
- expiration
Time String Expiration time in RFC3339 format. Pay-As-You-Go instances are never expire.
- id String
The ID of the MongoDB instance.
- instance
Class String Sizing of the instance to be queried.
- instance
Type 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
.- lock
Mode String Lock status of the instance.
- mongos List<Property Map>
Array composed of Mongos.
- name String
The name of the MongoDB instance.
- network
Type String Classic network or VPC.
- region
Id String Region ID the instance belongs to.
- replication String
Replication factor corresponds to number of nodes. Optional values are
1
for single node and3
for three nodes replica set.- List<Property Map>
Array composed of shards.
- status String
Status of the instance.
- storage Number
Shard disk.
- Map<Any>
A mapping of tags to assign to the resource.
GetInstancesInstanceMongo
- Class string
Shard instance specification.
- Description string
Shard instance description.
- Node
Id string Shard instance ID.
- Class string
Shard instance specification.
- Description string
Shard instance description.
- Node
Id string Shard instance ID.
- class_ String
Shard instance specification.
- description String
Shard instance description.
- node
Id String Shard instance ID.
- class string
Shard instance specification.
- description string
Shard instance description.
- node
Id 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.
- node
Id String Shard instance ID.
GetInstancesInstanceShard
- Class string
Shard instance specification.
- Description string
Shard instance description.
- Node
Id string Shard instance ID.
- Storage int
Shard disk.
- Class string
Shard instance specification.
- Description string
Shard instance description.
- Node
Id string Shard instance ID.
- Storage int
Shard disk.
- class_ String
Shard instance specification.
- description String
Shard instance description.
- node
Id String Shard instance ID.
- storage Integer
Shard disk.
- class string
Shard instance specification.
- description string
Shard instance description.
- node
Id 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.
- node
Id String Shard instance ID.
- storage Number
Shard disk.
Package Details
- Repository
- https://github.com/pulumi/pulumi-alicloud
- License
- Apache-2.0
- Notes
This Pulumi package is based on the
alicloud
Terraform Provider.