Alibaba Cloud

Pulumi Official
Package maintained by Pulumi
v3.22.0 published on Monday, Jun 27, 2022 by Pulumi

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; }
}
package main

import (
	"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/gpdb"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		gpdb, err := gpdb.GetInstances(ctx, &gpdb.GetInstancesArgs{
			AvailabilityZone: pulumi.StringRef("cn-beijing-c"),
			NameRegex:        pulumi.StringRef("gp-.+\\d+"),
			OutputFile:       pulumi.StringRef("instances.txt"),
		}, nil)
		if err != nil {
			return err
		}
		ctx.Export("instanceId", gpdb.Instances[0].Id)
		return nil
	})
}

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",
}));

export const instanceId = gpdb.instances[0].id;

Coming soon!

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,
                  name_regex: Optional[str] = None,
                  output_file: Optional[str] = None,
                  tags: Optional[Mapping[str, Any]] = None,
                  vswitch_id: Optional[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,
                  name_regex: Optional[pulumi.Input[str]] = None,
                  output_file: Optional[pulumi.Input[str]] = None,
                  tags: Optional[pulumi.Input[Mapping[str, Any]]] = None,
                  vswitch_id: Optional[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)
// Output-based functions aren't available in Java yet
Fn::Invoke:
  Function: alicloud:gpdb/getInstances:getInstances
  Arguments:
    # Arguments dictionary

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 List<String>

A list of instance IDs.

nameRegex String

A regex string to apply to the instance name.

outputFile String
tags Map<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 {[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 Sequence[str]

A list of instance IDs.

name_regex str

A regex string to apply to the instance name.

output_file str
tags Mapping[str, Any]

A mapping of tags to assign to the resource.

vswitch_id str

Used to retrieve instances belong to specified vswitch resources.

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 Map<Any>

A mapping of tags to assign to the resource.

vswitchId String

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 List<String>

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<String>

The names list of AnalyticDB for PostgreSQL instance.

availabilityZone String

Instance availability zone.

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

The provider-assigned unique ID for this managed resource.

ids Sequence[str]

The ids list of AnalyticDB for PostgreSQL instances.

instances Sequence[GetInstancesInstance]

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

names Sequence[str]

The names list of AnalyticDB for PostgreSQL instance.

availability_zone str

Instance availability zone.

name_regex str
output_file str
tags Mapping[str, Any]
vswitch_id str
id String

The provider-assigned unique ID for this managed resource.

ids List<String>

The ids list of AnalyticDB for PostgreSQL instances.

instances List<Property Map>

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 Map<Any>
vswitchId String

Supporting Types

GetInstancesInstance

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.

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.

instance_class str

The group type.

instance_group_count str

The number of groups.

instance_network_type str
region_id str

Region ID the instance belongs to.

status str

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.

Package Details

Repository
https://github.com/pulumi/pulumi-alicloud
License
Apache-2.0
Notes

This Pulumi package is based on the alicloud Terraform Provider.