GetInstances
The alicloud.rds.getInstances data source provides a collection of RDS instances available in Alibaba Cloud account.
Filters support regular expression for the instance name, searches by tags, and other filters which are listed below.
Example Usage
using Pulumi;
using AliCloud = Pulumi.AliCloud;
class MyStack : Stack
{
public MyStack()
{
var dbInstancesDs = Output.Create(AliCloud.Rds.GetInstances.InvokeAsync(new AliCloud.Rds.GetInstancesArgs
{
NameRegex = "data-\\d+",
Status = "Running",
Tags =
{
{ "size", "tiny" },
{ "type", "database" },
},
}));
this.FirstDbInstanceId = dbInstancesDs.Apply(dbInstancesDs => dbInstancesDs.Instances[0].Id);
}
[Output("firstDbInstanceId")]
public Output<string> FirstDbInstanceId { get; set; }
}
Coming soon!
import pulumi
import pulumi_alicloud as alicloud
db_instances_ds = alicloud.rds.get_instances(name_regex="data-\\d+",
status="Running",
tags={
"size": "tiny",
"type": "database",
})
pulumi.export("firstDbInstanceId", db_instances_ds.instances[0]["id"])import * as pulumi from "@pulumi/pulumi";
import * as alicloud from "@pulumi/alicloud";
const dbInstancesDs = pulumi.output(alicloud.rds.getInstances({
nameRegex: "data-\\d+",
status: "Running",
tags: {
size: "tiny",
type: "database",
},
}, { async: true }));
export const firstDbInstanceId = dbInstancesDs.instances[0].id;Using GetInstances
function getInstances(args: GetInstancesArgs, opts?: InvokeOptions): Promise<GetInstancesResult>function get_instances(connection_mode=None, db_type=None, engine=None, ids=None, name_regex=None, output_file=None, status=None, tags=None, vpc_id=None, vswitch_id=None, opts=None)func GetInstances(ctx *Context, args *GetInstancesArgs, opts ...InvokeOption) (*GetInstancesResult, error)public static class GetInstances {
public static Task<GetInstancesResult> InvokeAsync(GetInstancesArgs args, InvokeOptions? opts = null)
}The following arguments are supported:
- Connection
Mode string Standardfor standard access mode andSafefor high security access mode.- Db
Type string Primaryfor primary instance,Readonlyfor read-only instance,Guardfor disaster recovery instance, andTempfor temporary instance.- Engine string
Database type. Options are
MySQL,SQLServer,PostgreSQLandPPAS. If no value is specified, all types are returned.- Ids List<string>
A list of RDS instance IDs.
- Name
Regex string A regex string to filter results by instance name.
- Output
File string - Status string
Status of the instance.
- Dictionary<string, object>
A map of tags assigned to the DB instances. Note: Before 1.60.0, the value’s format is a
jsonstring which includingTagKeyandTagValue.TagKeycannot be null, andTagValuecan be empty. Format example"{\"key1\":\"value1\"}"- Vpc
Id string Used to retrieve instances belong to specified VPC.
- Vswitch
Id string Used to retrieve instances belong to specified
vswitchresources.
- Connection
Mode string Standardfor standard access mode andSafefor high security access mode.- Db
Type string Primaryfor primary instance,Readonlyfor read-only instance,Guardfor disaster recovery instance, andTempfor temporary instance.- Engine string
Database type. Options are
MySQL,SQLServer,PostgreSQLandPPAS. If no value is specified, all types are returned.- Ids []string
A list of RDS instance IDs.
- Name
Regex string A regex string to filter results by instance name.
- Output
File string - Status string
Status of the instance.
- map[string]interface{}
A map of tags assigned to the DB instances. Note: Before 1.60.0, the value’s format is a
jsonstring which includingTagKeyandTagValue.TagKeycannot be null, andTagValuecan be empty. Format example"{\"key1\":\"value1\"}"- Vpc
Id string Used to retrieve instances belong to specified VPC.
- Vswitch
Id string Used to retrieve instances belong to specified
vswitchresources.
- connection
Mode string Standardfor standard access mode andSafefor high security access mode.- db
Type string Primaryfor primary instance,Readonlyfor read-only instance,Guardfor disaster recovery instance, andTempfor temporary instance.- engine string
Database type. Options are
MySQL,SQLServer,PostgreSQLandPPAS. If no value is specified, all types are returned.- ids string[]
A list of RDS instance IDs.
- name
Regex string A regex string to filter results by instance name.
- output
File string - status string
Status of the instance.
- {[key: string]: any}
A map of tags assigned to the DB instances. Note: Before 1.60.0, the value’s format is a
jsonstring which includingTagKeyandTagValue.TagKeycannot be null, andTagValuecan be empty. Format example"{\"key1\":\"value1\"}"- vpc
Id string Used to retrieve instances belong to specified VPC.
- vswitch
Id string Used to retrieve instances belong to specified
vswitchresources.
- connection_
mode str Standardfor standard access mode andSafefor high security access mode.- db_
type str Primaryfor primary instance,Readonlyfor read-only instance,Guardfor disaster recovery instance, andTempfor temporary instance.- engine str
Database type. Options are
MySQL,SQLServer,PostgreSQLandPPAS. If no value is specified, all types are returned.- ids List[str]
A list of RDS instance IDs.
- name_
regex str A regex string to filter results by instance name.
- output_
file str - status str
Status of the instance.
- Dict[str, Any]
A map of tags assigned to the DB instances. Note: Before 1.60.0, the value’s format is a
jsonstring which includingTagKeyandTagValue.TagKeycannot be null, andTagValuecan be empty. Format example"{\"key1\":\"value1\"}"- vpc_
id str Used to retrieve instances belong to specified VPC.
- vswitch_
id str Used to retrieve instances belong to specified
vswitchresources.
GetInstances Result
The following output properties are available:
- Id string
The provider-assigned unique ID for this managed resource.
- Ids List<string>
A list of RDS instance IDs.
- Instances
List<Pulumi.
Ali Cloud. Rds. Outputs. Get Instances Instance> A list of RDS instances. Each element contains the following attributes:
- Names List<string>
A list of RDS instance names.
- Connection
Mode string Standardfor standard access mode andSafefor high security access mode.- Db
Type string Primaryfor primary instance,Readonlyfor read-only instance,Guardfor disaster recovery instance, andTempfor temporary instance.- Engine string
Database type. Options are
MySQL,SQLServer,PostgreSQLandPPAS. If no value is specified, all types are returned.- Name
Regex string - Output
File string - Status string
Status of the instance.
- Dictionary<string, object>
- Vpc
Id string ID of the VPC the instance belongs to.
- Vswitch
Id string ID of the VSwitch the instance belongs to.
- Id string
The provider-assigned unique ID for this managed resource.
- Ids []string
A list of RDS instance IDs.
- Instances
[]Get
Instances Instance A list of RDS instances. Each element contains the following attributes:
- Names []string
A list of RDS instance names.
- Connection
Mode string Standardfor standard access mode andSafefor high security access mode.- Db
Type string Primaryfor primary instance,Readonlyfor read-only instance,Guardfor disaster recovery instance, andTempfor temporary instance.- Engine string
Database type. Options are
MySQL,SQLServer,PostgreSQLandPPAS. If no value is specified, all types are returned.- Name
Regex string - Output
File string - Status string
Status of the instance.
- map[string]interface{}
- Vpc
Id string ID of the VPC the instance belongs to.
- Vswitch
Id string ID of the VSwitch the instance belongs to.
- id string
The provider-assigned unique ID for this managed resource.
- ids string[]
A list of RDS instance IDs.
- instances
Get
Instances Instance[] A list of RDS instances. Each element contains the following attributes:
- names string[]
A list of RDS instance names.
- connection
Mode string Standardfor standard access mode andSafefor high security access mode.- db
Type string Primaryfor primary instance,Readonlyfor read-only instance,Guardfor disaster recovery instance, andTempfor temporary instance.- engine string
Database type. Options are
MySQL,SQLServer,PostgreSQLandPPAS. If no value is specified, all types are returned.- name
Regex string - output
File string - status string
Status of the instance.
- {[key: string]: any}
- vpc
Id string ID of the VPC the instance belongs to.
- vswitch
Id string ID of the VSwitch the instance belongs to.
- id str
The provider-assigned unique ID for this managed resource.
- ids List[str]
A list of RDS instance IDs.
- instances
List[Get
Instances Instance] A list of RDS instances. Each element contains the following attributes:
- names List[str]
A list of RDS instance names.
- connection_
mode str Standardfor standard access mode andSafefor high security access mode.- db_
type str Primaryfor primary instance,Readonlyfor read-only instance,Guardfor disaster recovery instance, andTempfor temporary instance.- engine str
Database type. Options are
MySQL,SQLServer,PostgreSQLandPPAS. If no value is specified, all types are returned.- name_
regex str - output_
file str - status str
Status of the instance.
- Dict[str, Any]
- vpc_
id str ID of the VPC the instance belongs to.
- vswitch_
id str ID of the VSwitch the instance belongs to.
Supporting Types
GetInstancesInstance
See the output API doc for this type.
See the output API doc for this type.
See the output API doc for this type.
- Availability
Zone string Availability zone.
- Charge
Type string Billing method. Value options:
Postpaidfor Pay-As-You-Go andPrepaidfor subscription.- Connection
Mode string Standardfor standard access mode andSafefor high security access mode.- Connection
String string (Available in 1.70.3+) RDS database connection string.
- Create
Time string Creation time of the instance.
- Db
Instance stringStorage Type (Available in 1.70.3+) The storage type of the instance.
- Db
Type string Primaryfor primary instance,Readonlyfor read-only instance,Guardfor disaster recovery instance, andTempfor temporary instance.- Engine string
Database type. Options are
MySQL,SQLServer,PostgreSQLandPPAS. If no value is specified, all types are returned.- Engine
Version string Database version.
- Expire
Time string Expiration time. Pay-As-You-Go instances never expire.
- Guard
Instance stringId If a disaster recovery instance is attached to the current instance, the ID of the disaster recovery instance applies.
- Id string
The ID of the RDS instance.
- Instance
Storage int (Available in 1.70.3+) User-defined DB instance storage space.
- Instance
Type string Sizing of the RDS instance.
- Master
Instance stringId ID of the primary instance. If this parameter is not returned, the current instance is a primary instance.
- Name string
The name of the RDS instance.
- Net
Type string Internetfor public network orIntranetfor private network.- Port string
(Available in 1.70.3+) RDS database connection port.
- Readonly
Instance List<string>Ids A list of IDs of read-only instances attached to the primary instance.
- Region
Id string Region ID the instance belongs to.
- Status string
Status of the instance.
- Temp
Instance stringId If a temporary instance is attached to the current instance, the ID of the temporary instance applies.
- Vpc
Id string Used to retrieve instances belong to specified VPC.
- Vswitch
Id string Used to retrieve instances belong to specified
vswitchresources.
- Availability
Zone string Availability zone.
- Charge
Type string Billing method. Value options:
Postpaidfor Pay-As-You-Go andPrepaidfor subscription.- Connection
Mode string Standardfor standard access mode andSafefor high security access mode.- Connection
String string (Available in 1.70.3+) RDS database connection string.
- Create
Time string Creation time of the instance.
- Db
Instance stringStorage Type (Available in 1.70.3+) The storage type of the instance.
- Db
Type string Primaryfor primary instance,Readonlyfor read-only instance,Guardfor disaster recovery instance, andTempfor temporary instance.- Engine string
Database type. Options are
MySQL,SQLServer,PostgreSQLandPPAS. If no value is specified, all types are returned.- Engine
Version string Database version.
- Expire
Time string Expiration time. Pay-As-You-Go instances never expire.
- Guard
Instance stringId If a disaster recovery instance is attached to the current instance, the ID of the disaster recovery instance applies.
- Id string
The ID of the RDS instance.
- Instance
Storage int (Available in 1.70.3+) User-defined DB instance storage space.
- Instance
Type string Sizing of the RDS instance.
- Master
Instance stringId ID of the primary instance. If this parameter is not returned, the current instance is a primary instance.
- Name string
The name of the RDS instance.
- Net
Type string Internetfor public network orIntranetfor private network.- Port string
(Available in 1.70.3+) RDS database connection port.
- Readonly
Instance []stringIds A list of IDs of read-only instances attached to the primary instance.
- Region
Id string Region ID the instance belongs to.
- Status string
Status of the instance.
- Temp
Instance stringId If a temporary instance is attached to the current instance, the ID of the temporary instance applies.
- Vpc
Id string Used to retrieve instances belong to specified VPC.
- Vswitch
Id string Used to retrieve instances belong to specified
vswitchresources.
- availability
Zone string Availability zone.
- charge
Type string Billing method. Value options:
Postpaidfor Pay-As-You-Go andPrepaidfor subscription.- connection
Mode string Standardfor standard access mode andSafefor high security access mode.- connection
String string (Available in 1.70.3+) RDS database connection string.
- create
Time string Creation time of the instance.
- db
Instance stringStorage Type (Available in 1.70.3+) The storage type of the instance.
- db
Type string Primaryfor primary instance,Readonlyfor read-only instance,Guardfor disaster recovery instance, andTempfor temporary instance.- engine string
Database type. Options are
MySQL,SQLServer,PostgreSQLandPPAS. If no value is specified, all types are returned.- engine
Version string Database version.
- expire
Time string Expiration time. Pay-As-You-Go instances never expire.
- guard
Instance stringId If a disaster recovery instance is attached to the current instance, the ID of the disaster recovery instance applies.
- id string
The ID of the RDS instance.
- instance
Storage number (Available in 1.70.3+) User-defined DB instance storage space.
- instance
Type string Sizing of the RDS instance.
- master
Instance stringId ID of the primary instance. If this parameter is not returned, the current instance is a primary instance.
- name string
The name of the RDS instance.
- net
Type string Internetfor public network orIntranetfor private network.- port string
(Available in 1.70.3+) RDS database connection port.
- readonly
Instance string[]Ids A list of IDs of read-only instances attached to the primary instance.
- region
Id string Region ID the instance belongs to.
- status string
Status of the instance.
- temp
Instance stringId If a temporary instance is attached to the current instance, the ID of the temporary instance applies.
- vpc
Id string Used to retrieve instances belong to specified VPC.
- vswitch
Id string Used to retrieve instances belong to specified
vswitchresources.
- availability_
zone str Availability zone.
- charge_
type str Billing method. Value options:
Postpaidfor Pay-As-You-Go andPrepaidfor subscription.- connection
Mode str Standardfor standard access mode andSafefor high security access mode.- connection_
string str (Available in 1.70.3+) RDS database connection string.
- create_
time str Creation time of the instance.
- db_
instance_ strstorage_ type (Available in 1.70.3+) The storage type of the instance.
- db_
type str Primaryfor primary instance,Readonlyfor read-only instance,Guardfor disaster recovery instance, andTempfor temporary instance.- engine str
Database type. Options are
MySQL,SQLServer,PostgreSQLandPPAS. If no value is specified, all types are returned.- engine_
version str Database version.
- expire_
time str Expiration time. Pay-As-You-Go instances never expire.
- guard
Instance strId If a disaster recovery instance is attached to the current instance, the ID of the disaster recovery instance applies.
- id str
The ID of the RDS instance.
- instance_
storage float (Available in 1.70.3+) User-defined DB instance storage space.
- instance_
type str Sizing of the RDS instance.
- master
Instance strId ID of the primary instance. If this parameter is not returned, the current instance is a primary instance.
- name str
The name of the RDS instance.
- net_
type str Internetfor public network orIntranetfor private network.- port str
(Available in 1.70.3+) RDS database connection port.
- readonly
Instance List[str]Ids A list of IDs of read-only instances attached to the primary instance.
- region
Id str Region ID the instance belongs to.
- status str
Status of the instance.
- temp
Instance strId If a temporary instance is attached to the current instance, the ID of the temporary instance applies.
- vpc_
id str Used to retrieve instances belong to specified VPC.
- vswitch_
id str Used to retrieve instances belong to specified
vswitchresources.
Package Details
- Repository
- https://github.com/pulumi/pulumi-alicloud
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
alicloudTerraform Provider.