GetInstances
The alicloud.gpdb.getInstances data source provides a collection of AnalyticDB for PostgreSQL instances available in Alicloud account.
Filters support regular expression for the instance name or availability_zone.
NOTE: Available in 1.47.0+
Example Usage
using Pulumi;
using AliCloud = Pulumi.AliCloud;
class MyStack : Stack
{
public MyStack()
{
var gpdb = Output.Create(AliCloud.Gpdb.GetInstances.InvokeAsync(new AliCloud.Gpdb.GetInstancesArgs
{
AvailabilityZone = "cn-beijing-c",
NameRegex = "gp-.+\\d+",
OutputFile = "instances.txt",
}));
this.InstanceId = gpdb.Apply(gpdb => gpdb.Instances[0].Id);
}
[Output("instanceId")]
public Output<string> InstanceId { get; set; }
}
Coming soon!
import pulumi
import pulumi_alicloud as alicloud
gpdb = alicloud.gpdb.get_instances(availability_zone="cn-beijing-c",
name_regex="gp-.+\\d+",
output_file="instances.txt")
pulumi.export("instanceId", gpdb.instances[0]["id"])import * as pulumi from "@pulumi/pulumi";
import * as alicloud from "@pulumi/alicloud";
const gpdb = pulumi.output(alicloud.gpdb.getInstances({
availabilityZone: "cn-beijing-c",
nameRegex: "gp-.+\\d+",
outputFile: "instances.txt",
}, { async: true }));
export const instanceId = gpdb.instances[0].id;Using GetInstances
function getInstances(args: GetInstancesArgs, opts?: InvokeOptions): Promise<GetInstancesResult>function get_instances(availability_zone=None, ids=None, name_regex=None, output_file=None, tags=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:
- Availability
Zone string Instance availability zone.
- Ids List<string>
A list of instance IDs.
- 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.
- Vswitch
Id string Used to retrieve instances belong to specified
vswitchresources.
- Availability
Zone string Instance availability zone.
- Ids []string
A list of instance IDs.
- 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.
- Vswitch
Id string Used to retrieve instances belong to specified
vswitchresources.
- availability
Zone string Instance availability zone.
- ids string[]
A list of instance IDs.
- 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.
- vswitch
Id string Used to retrieve instances belong to specified
vswitchresources.
- availability_
zone str Instance availability zone.
- ids List[str]
A list of instance IDs.
- name_
regex str A regex string to apply to the instance name.
- output_
file str - Dict[str, Any]
A mapping of tags to assign to the resource.
- 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>
The ids list of AnalyticDB for PostgreSQL instances.
- Instances
List<Pulumi.
Ali Cloud. Gpdb. Outputs. Get Instances Instance> A list of AnalyticDB for PostgreSQL instances. Its every element contains the following attributes:
- Names List<string>
The names list of AnalyticDB for PostgreSQL instance.
- Availability
Zone string Instance availability zone.
- Name
Regex string - Output
File string - Dictionary<string, object>
- Vswitch
Id string
- Id string
The provider-assigned unique ID for this managed resource.
- Ids []string
The ids list of AnalyticDB for PostgreSQL instances.
- Instances
[]Get
Instances Instance A list of AnalyticDB for PostgreSQL instances. Its every element contains the following attributes:
- Names []string
The names list of AnalyticDB for PostgreSQL instance.
- Availability
Zone string Instance availability zone.
- Name
Regex string - Output
File string - map[string]interface{}
- Vswitch
Id string
- id string
The provider-assigned unique ID for this managed resource.
- ids string[]
The ids list of AnalyticDB for PostgreSQL instances.
- instances
Get
Instances Instance[] A list of AnalyticDB for PostgreSQL instances. Its every element contains the following attributes:
- names string[]
The names list of AnalyticDB for PostgreSQL instance.
- availability
Zone string Instance availability zone.
- name
Regex string - output
File string - {[key: string]: any}
- vswitch
Id string
- id str
The provider-assigned unique ID for this managed resource.
- ids List[str]
The ids list of AnalyticDB for PostgreSQL instances.
- instances
List[Get
Instances Instance] A list of AnalyticDB for PostgreSQL instances. Its every element contains the following attributes:
- names List[str]
The names list of AnalyticDB for PostgreSQL instance.
- availability_
zone str Instance availability zone.
- name_
regex str - output_
file str - Dict[str, Any]
- vswitch_
id str
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 Instance availability zone.
- Charge
Type string Billing method. Value options are
PostPaidfor Pay-As-You-Go andPrePaidfor yearly or monthly subscription.- Creation
Time string The time when you create an instance. The format is YYYY-MM-DDThh:mm:ssZ, such as 2011-05-30T12:11:4Z.
- Description string
The description of an instance.
- Engine string
Database engine type. Supported option is
gpdb.- Engine
Version string Database engine version.
- Id string
The instance id.
- Instance
Class string The group type.
- Instance
Group stringCount The number of groups.
- Instance
Network stringType - Region
Id string Region ID the instance belongs to.
- Status string
Status of the instance.
- Availability
Zone string Instance availability zone.
- Charge
Type string Billing method. Value options are
PostPaidfor Pay-As-You-Go andPrePaidfor yearly or monthly subscription.- Creation
Time string The time when you create an instance. The format is YYYY-MM-DDThh:mm:ssZ, such as 2011-05-30T12:11:4Z.
- Description string
The description of an instance.
- Engine string
Database engine type. Supported option is
gpdb.- Engine
Version string Database engine version.
- Id string
The instance id.
- Instance
Class string The group type.
- Instance
Group stringCount The number of groups.
- Instance
Network stringType - Region
Id string Region ID the instance belongs to.
- Status string
Status of the instance.
- availability
Zone string Instance availability zone.
- charge
Type string Billing method. Value options are
PostPaidfor Pay-As-You-Go andPrePaidfor yearly or monthly subscription.- creation
Time string The time when you create an instance. The format is YYYY-MM-DDThh:mm:ssZ, such as 2011-05-30T12:11:4Z.
- description string
The description of an instance.
- engine string
Database engine type. Supported option is
gpdb.- engine
Version string Database engine version.
- id string
The instance id.
- instance
Class string The group type.
- instance
Group stringCount The number of groups.
- instance
Network stringType - region
Id string Region ID the instance belongs to.
- status string
Status of the instance.
- 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 The time when you create an instance. The format is YYYY-MM-DDThh:mm:ssZ, such as 2011-05-30T12:11:4Z.
- description str
The description of an instance.
- engine str
Database engine type. Supported option is
gpdb.- engine_
version str Database engine version.
- id str
The instance id.
- instance
Network strType - instance_
class str The group type.
- instance_
group_ strcount The number of groups.
- region
Id str Region ID the instance belongs to.
- status str
Status of the instance.
Package Details
- Repository
- https://github.com/pulumi/pulumi-alicloud
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
alicloudTerraform Provider.