Alibaba Cloud
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:
- 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
vswitch
resources.
- 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
vswitch
resources.
- 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 - Map<String,Object>
A mapping of tags to assign to the resource.
- vswitch
Id String Used to retrieve instances belong to specified
vswitch
resources.
- 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
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 - Mapping[str, Any]
A mapping of tags to assign to the resource.
- vswitch_
id str Used to retrieve instances belong to specified
vswitch
resources.
- 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 - Map<Any>
A mapping of tags to assign to the resource.
- vswitch
Id 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.
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 List<String>
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<String>
The names list of AnalyticDB for PostgreSQL instance.
- availability
Zone String Instance availability zone.
- name
Regex String - output
File String - Map<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 - {[key: string]: any}
- vswitch
Id 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[Get
Instances Instance] 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 - 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.
- availability
Zone String Instance availability zone.
- name
Regex String - output
File String - Map<Any>
- vswitch
Id String
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 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
PostPaid
for Pay-As-You-Go andPrePaid
for 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
PostPaid
for Pay-As-You-Go andPrePaid
for 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
PostPaid
for Pay-As-You-Go andPrePaid
for 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
PostPaid
for Pay-As-You-Go andPrePaid
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_ strcount The number of groups.
- instance_
network_ strtype - region_
id str Region ID the instance belongs to.
- status str
Status of the instance.
- 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 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.
Package Details
- Repository
- https://github.com/pulumi/pulumi-alicloud
- License
- Apache-2.0
- Notes
This Pulumi package is based on the
alicloud
Terraform Provider.