GetInstances

This data source provides a list of ONS Instances in an Alibaba Cloud account according to the specified filters.

NOTE: Available in 1.52.0+

Example Usage

using Pulumi;
using AliCloud = Pulumi.AliCloud;

class MyStack : Stack
{
    public MyStack()
    {
        var config = new Config();
        var name = config.Get("name") ?? "onsInstanceDatasourceName";
        var @default = new AliCloud.RocketMQ.Instance("default", new AliCloud.RocketMQ.InstanceArgs
        {
            Remark = "default_ons_instance_remark",
        });
        var instancesDs = Output.Tuple(@default.Id, @default.Name).Apply(values =>
        {
            var id = values.Item1;
            var name = values.Item2;
            return AliCloud.RocketMQ.GetInstances.InvokeAsync(new AliCloud.RocketMQ.GetInstancesArgs
            {
                Ids = 
                {
                    id,
                },
                NameRegex = name,
                OutputFile = "instances.txt",
            });
        });
        this.FirstInstanceId = instancesDs.Apply(instancesDs => instancesDs.Instances[0].InstanceId);
    }

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

Coming soon!

import pulumi
import pulumi_alicloud as alicloud

config = pulumi.Config()
name = config.get("name")
if name is None:
    name = "onsInstanceDatasourceName"
default = alicloud.rocketmq.Instance("default", remark="default_ons_instance_remark")
instances_ds = pulumi.Output.all(default.id, default.name).apply(lambda id, name: alicloud.rocketmq.get_instances(ids=[id],
    name_regex=name,
    output_file="instances.txt"))
pulumi.export("firstInstanceId", instances_ds.instances[0]["instance_id"])
import * as pulumi from "@pulumi/pulumi";
import * as alicloud from "@pulumi/alicloud";

const config = new pulumi.Config();
const name = config.get("name") || "onsInstanceDatasourceName";

const defaultInstance = new alicloud.rocketmq.Instance("default", {
    remark: "default_ons_instance_remark",
});
const instancesDs = pulumi.all([defaultInstance.id, defaultInstance.name]).apply(([id, name]) => alicloud.rocketmq.getInstances({
    ids: [id],
    nameRegex: name,
    outputFile: "instances.txt",
}, { async: true }));

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

Using GetInstances

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

NameRegex string

A regex string to filter results by the instance name.

OutputFile string
Ids []string

A list of instance IDs to filter results.

NameRegex string

A regex string to filter results by the instance name.

OutputFile string
ids string[]

A list of instance IDs to filter results.

nameRegex string

A regex string to filter results by the instance name.

outputFile string
ids List[str]

A list of instance IDs to filter results.

name_regex str

A regex string to filter results by the instance name.

output_file str

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.RocketMQ.Outputs.GetInstancesInstance>

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

Names List<string>

A list of instance names.

NameRegex string
OutputFile string
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
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
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

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.

Id string

ID of the instance.

InstanceId string

ID of the instance.

InstanceName string

Name of the instance.

InstanceStatus int

The status of the instance. Read Fields in InstanceVO for further details.

InstanceType int

The type of the instance. Read Fields in InstanceVO for further details.

ReleaseTime int

The automatic release time of an Enterprise Platinum Edition instance.

Id string

ID of the instance.

InstanceId string

ID of the instance.

InstanceName string

Name of the instance.

InstanceStatus int

The status of the instance. Read Fields in InstanceVO for further details.

InstanceType int

The type of the instance. Read Fields in InstanceVO for further details.

ReleaseTime int

The automatic release time of an Enterprise Platinum Edition instance.

id string

ID of the instance.

instanceId string

ID of the instance.

instanceName string

Name of the instance.

instanceStatus number

The status of the instance. Read Fields in InstanceVO for further details.

instanceType number

The type of the instance. Read Fields in InstanceVO for further details.

releaseTime number

The automatic release time of an Enterprise Platinum Edition instance.

id str

ID of the instance.

instance_id str

ID of the instance.

instance_name str

Name of the instance.

instance_status float

The status of the instance. Read Fields in InstanceVO for further details.

instance_type float

The type of the instance. Read Fields in InstanceVO for further details.

release_time float

The automatic release time of an Enterprise Platinum Edition 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.