GetInstances

This data source provides the ots instances of the current Alibaba Cloud user.

Example Usage

using Pulumi;
using AliCloud = Pulumi.AliCloud;

class MyStack : Stack
{
    public MyStack()
    {
        var instancesDs = Output.Create(AliCloud.Oss.GetInstances.InvokeAsync(new AliCloud.Oss.GetInstancesArgs
        {
            NameRegex = "sample-instance",
            OutputFile = "instances.txt",
        }));
        this.FirstInstanceId = instancesDs.Apply(instancesDs => instancesDs.Instances[0].Id);
    }

    [Output("firstInstanceId")]
    public Output<string> FirstInstanceId { get; set; }
}

Coming soon!

import pulumi
import pulumi_alicloud as alicloud

instances_ds = alicloud.oss.get_instances(name_regex="sample-instance",
    output_file="instances.txt")
pulumi.export("firstInstanceId", instances_ds.instances[0]["id"])
import * as pulumi from "@pulumi/pulumi";
import * as alicloud from "@pulumi/alicloud";

const instancesDs = pulumi.output(alicloud.oss.getInstances({
    nameRegex: "sample-instance",
    outputFile: "instances.txt",
}, { async: true }));

export const firstInstanceId = instancesDs.instances[0].id;

Using GetInstances

function getInstances(args: GetInstancesArgs, opts?: InvokeOptions): Promise<GetInstancesResult>
function  get_instances(ids=None, name_regex=None, output_file=None, tags=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:

Ids List<string>

A list of instance IDs.

NameRegex string

A regex string to filter results by instance name.

OutputFile string
Tags Dictionary<string, object>

A map of tags assigned to the instance. It must be in the format:

data "alicloud.oss.getInstances" "instances_ds" {
tags = {
tagKey1 = "tagValue1",
tagKey2 = "tagValue2"
}
}
Ids []string

A list of instance IDs.

NameRegex string

A regex string to filter results by instance name.

OutputFile string
Tags map[string]interface{}

A map of tags assigned to the instance. It must be in the format:

data "alicloud.oss.getInstances" "instances_ds" {
tags = {
tagKey1 = "tagValue1",
tagKey2 = "tagValue2"
}
}
ids string[]

A list of instance IDs.

nameRegex string

A regex string to filter results by instance name.

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

A map of tags assigned to the instance. It must be in the format:

data "alicloud.oss.getInstances" "instances_ds" {
tags = {
tagKey1 = "tagValue1",
tagKey2 = "tagValue2"
}
}
ids List[str]

A list of instance IDs.

name_regex str

A regex string to filter results by instance name.

output_file str
tags Dict[str, Any]

A map of tags assigned to the instance. It must be in the format:

data "alicloud.oss.getInstances" "instances_ds" {
tags = {
tagKey1 = "tagValue1",
tagKey2 = "tagValue2"
}
}

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 instance IDs.

Instances List<Pulumi.AliCloud.Oss.Outputs.GetInstancesInstance>

A list of instances. Each element contains the following attributes:

Names List<string>

A list of instance names.

NameRegex string
OutputFile string
Tags Dictionary<string, object>

The tags of the instance.

Id string

The provider-assigned unique ID for this managed resource.

Ids []string

A list of instance IDs.

Instances []GetInstancesInstance

A list of instances. Each element contains the following attributes:

Names []string

A list of instance names.

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

The tags of the instance.

id string

The provider-assigned unique ID for this managed resource.

ids string[]

A list of instance IDs.

instances GetInstancesInstance[]

A list of instances. Each element contains the following attributes:

names string[]

A list of instance names.

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

The tags of the instance.

id str

The provider-assigned unique ID for this managed resource.

ids List[str]

A list of instance IDs.

instances List[GetInstancesInstance]

A list of instances. Each element contains the following attributes:

names List[str]

A list of instance names.

name_regex str
output_file str
tags Dict[str, Any]

The tags of the instance.

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.

ClusterType string

The cluster type of the instance. Possible values: SSD, HYBRID.

CreateTime string

The create time of the instance.

Description string

The description of the instance.

EntityQuota int

The instance quota which indicating the maximum number of tables.

Id string

ID of the instance.

Name string

Instance name.

Network string

The network type of the instance. Possible values: NORMAL, VPC, VPC_CONSOLE.

ReadCapacity int

The maximum adjustable read capacity unit of the instance.

Status string

Instance status. Possible values: Running, Disabled, Deleting.

Tags Dictionary<string, object>

A map of tags assigned to the instance. It must be in the format:

data "alicloud.oss.getInstances" "instances_ds" {
tags = {
tagKey1 = "tagValue1",
tagKey2 = "tagValue2"
}
}
UserId string

The user id of the instance.

WriteCapacity int

The maximum adjustable write capacity unit of the instance.

ClusterType string

The cluster type of the instance. Possible values: SSD, HYBRID.

CreateTime string

The create time of the instance.

Description string

The description of the instance.

EntityQuota int

The instance quota which indicating the maximum number of tables.

Id string

ID of the instance.

Name string

Instance name.

Network string

The network type of the instance. Possible values: NORMAL, VPC, VPC_CONSOLE.

ReadCapacity int

The maximum adjustable read capacity unit of the instance.

Status string

Instance status. Possible values: Running, Disabled, Deleting.

Tags map[string]interface{}

A map of tags assigned to the instance. It must be in the format:

data "alicloud.oss.getInstances" "instances_ds" {
tags = {
tagKey1 = "tagValue1",
tagKey2 = "tagValue2"
}
}
UserId string

The user id of the instance.

WriteCapacity int

The maximum adjustable write capacity unit of the instance.

clusterType string

The cluster type of the instance. Possible values: SSD, HYBRID.

createTime string

The create time of the instance.

description string

The description of the instance.

entityQuota number

The instance quota which indicating the maximum number of tables.

id string

ID of the instance.

name string

Instance name.

network string

The network type of the instance. Possible values: NORMAL, VPC, VPC_CONSOLE.

readCapacity number

The maximum adjustable read capacity unit of the instance.

status string

Instance status. Possible values: Running, Disabled, Deleting.

tags {[key: string]: any}

A map of tags assigned to the instance. It must be in the format:

data "alicloud.oss.getInstances" "instances_ds" {
tags = {
tagKey1 = "tagValue1",
tagKey2 = "tagValue2"
}
}
userId string

The user id of the instance.

writeCapacity number

The maximum adjustable write capacity unit of the instance.

cluster_type str

The cluster type of the instance. Possible values: SSD, HYBRID.

create_time str

The create time of the instance.

description str

The description of the instance.

entityQuota float

The instance quota which indicating the maximum number of tables.

id str

ID of the instance.

name str

Instance name.

network str

The network type of the instance. Possible values: NORMAL, VPC, VPC_CONSOLE.

readCapacity float

The maximum adjustable read capacity unit of the instance.

status str

Instance status. Possible values: Running, Disabled, Deleting.

tags Dict[str, Any]

A map of tags assigned to the instance. It must be in the format:

data "alicloud.oss.getInstances" "instances_ds" {
tags = {
tagKey1 = "tagValue1",
tagKey2 = "tagValue2"
}
}
userId str

The user id of the instance.

writeCapacity float

The maximum adjustable write capacity unit 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.