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:

AvailabilityZone string

Instance availability zone.

Ids List<string>

A list of instance IDs.

NameRegex string

A regex string to apply to the instance name.

OutputFile string
Tags Dictionary<string, object>

A mapping of tags to assign to the resource.

VswitchId string

Used to retrieve instances belong to specified vswitch resources.

AvailabilityZone string

Instance availability zone.

Ids []string

A list of instance IDs.

NameRegex string

A regex string to apply to the instance name.

OutputFile string
Tags map[string]interface{}

A mapping of tags to assign to the resource.

VswitchId string

Used to retrieve instances belong to specified vswitch resources.

availabilityZone string

Instance availability zone.

ids string[]

A list of instance IDs.

nameRegex string

A regex string to apply to the instance name.

outputFile string
tags {[key: string]: any}

A mapping of tags to assign to the resource.

vswitchId string

Used to retrieve instances belong to specified vswitch resources.

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
tags Dict[str, Any]

A mapping of tags to assign to the resource.

vswitch_id str

Used to retrieve instances belong to specified vswitch resources.

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.AliCloud.Gpdb.Outputs.GetInstancesInstance>

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.

AvailabilityZone string

Instance availability zone.

NameRegex string
OutputFile string
Tags Dictionary<string, object>
VswitchId string
Id string

The provider-assigned unique ID for this managed resource.

Ids []string

The ids list of AnalyticDB for PostgreSQL instances.

Instances []GetInstancesInstance

A list of AnalyticDB for PostgreSQL instances. Its every element contains the following attributes:

Names []string

The names list of AnalyticDB for PostgreSQL instance.

AvailabilityZone string

Instance availability zone.

NameRegex string
OutputFile string
Tags map[string]interface{}
VswitchId string
id string

The provider-assigned unique ID for this managed resource.

ids string[]

The ids list of AnalyticDB for PostgreSQL instances.

instances GetInstancesInstance[]

A list of AnalyticDB for PostgreSQL instances. Its every element contains the following attributes:

names string[]

The names list of AnalyticDB for PostgreSQL instance.

availabilityZone string

Instance availability zone.

nameRegex string
outputFile string
tags {[key: string]: any}
vswitchId 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[GetInstancesInstance]

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
tags 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.

AvailabilityZone string

Instance availability zone.

ChargeType string

Billing method. Value options are PostPaid for Pay-As-You-Go and PrePaid for yearly or monthly subscription.

CreationTime 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.

EngineVersion string

Database engine version.

Id string

The instance id.

InstanceClass string

The group type.

InstanceGroupCount string

The number of groups.

InstanceNetworkType string
RegionId string

Region ID the instance belongs to.

Status string

Status of the instance.

AvailabilityZone string

Instance availability zone.

ChargeType string

Billing method. Value options are PostPaid for Pay-As-You-Go and PrePaid for yearly or monthly subscription.

CreationTime 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.

EngineVersion string

Database engine version.

Id string

The instance id.

InstanceClass string

The group type.

InstanceGroupCount string

The number of groups.

InstanceNetworkType string
RegionId string

Region ID the instance belongs to.

Status string

Status of the instance.

availabilityZone string

Instance availability zone.

chargeType string

Billing method. Value options are PostPaid for Pay-As-You-Go and PrePaid for yearly or monthly subscription.

creationTime 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.

engineVersion string

Database engine version.

id string

The instance id.

instanceClass string

The group type.

instanceGroupCount string

The number of groups.

instanceNetworkType string
regionId 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 PostPaid for Pay-As-You-Go and PrePaid for 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.

instanceNetworkType str
instance_class str

The group type.

instance_group_count str

The number of groups.

regionId 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 alicloud Terraform Provider.