Alibaba Cloud

Pulumi Official
Package maintained by Pulumi
v3.19.0 published on Friday, Mar 18, 2022 by Pulumi

getInstances

This data source provides the Eais Instances of the current Alibaba Cloud user.

NOTE: Available in v1.137.0+.

Example Usage

using Pulumi;
using AliCloud = Pulumi.AliCloud;

class MyStack : Stack
{
    public MyStack()
    {
        var ids = Output.Create(AliCloud.Eais.GetInstances.InvokeAsync(new AliCloud.Eais.GetInstancesArgs
        {
            Id = 
            {
                "example_id",
            },
        }));
        this.EaisInstanceId1 = ids.Apply(ids => ids.Instances?[0]?.Id);
        var nameRegex = Output.Create(AliCloud.Eais.GetInstances.InvokeAsync(new AliCloud.Eais.GetInstancesArgs
        {
            NameRegex = "^my-Instance",
        }));
        this.EaisInstanceId2 = nameRegex.Apply(nameRegex => nameRegex.Instances?[0]?.Id);
    }

    [Output("eaisInstanceId1")]
    public Output<string> EaisInstanceId1 { get; set; }
    [Output("eaisInstanceId2")]
    public Output<string> EaisInstanceId2 { get; set; }
}
package main

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

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		ids, err := eais.GetInstances(ctx, &eais.GetInstancesArgs{
			Id: []string{
				"example_id",
			},
		}, nil)
		if err != nil {
			return err
		}
		ctx.Export("eaisInstanceId1", ids.Instances[0].Id)
		nameRegex, err := eais.GetInstances(ctx, &eais.GetInstancesArgs{
			NameRegex: pulumi.StringRef("^my-Instance"),
		}, nil)
		if err != nil {
			return err
		}
		ctx.Export("eaisInstanceId2", nameRegex.Instances[0].Id)
		return nil
	})
}

Coming soon!

import pulumi
import pulumi_alicloud as alicloud

ids = alicloud.eais.get_instances(id=["example_id"])
pulumi.export("eaisInstanceId1", ids.instances[0].id)
name_regex = alicloud.eais.get_instances(name_regex="^my-Instance")
pulumi.export("eaisInstanceId2", name_regex.instances[0].id)
import * as pulumi from "@pulumi/pulumi";
import * as alicloud from "@pulumi/alicloud";

const ids = alicloud.eais.getInstances({
    id: ["example_id"],
});
export const eaisInstanceId1 = ids.then(ids => ids.instances?[0]?.id);
const nameRegex = alicloud.eais.getInstances({
    nameRegex: "^my-Instance",
});
export const eaisInstanceId2 = nameRegex.then(nameRegex => nameRegex.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(ids: Optional[Sequence[str]] = None,
                  instance_type: Optional[str] = None,
                  name_regex: Optional[str] = None,
                  output_file: Optional[str] = None,
                  status: Optional[str] = None,
                  opts: Optional[InvokeOptions] = None) -> GetInstancesResult
def get_instances_output(ids: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
                  instance_type: Optional[pulumi.Input[str]] = None,
                  name_regex: Optional[pulumi.Input[str]] = None,
                  output_file: Optional[pulumi.Input[str]] = None,
                  status: 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:eais/getInstances:getInstances
  Arguments:
    # Arguments dictionary

The following arguments are supported:

Ids List<string>

A list of Instance IDs.

InstanceType string

The type of the resource. Valid values: eais.ei-a6.4xlarge, eais.ei-a6.2xlarge, eais.ei-a6.xlarge, eais.ei-a6.large, eais.ei-a6.medium.

NameRegex string

A regex string to filter results by Instance name.

OutputFile string
Status string

The status of the resource. Valid values: Attaching, Available, Detaching, InUse, Starting, Unavailable.

Ids []string

A list of Instance IDs.

InstanceType string

The type of the resource. Valid values: eais.ei-a6.4xlarge, eais.ei-a6.2xlarge, eais.ei-a6.xlarge, eais.ei-a6.large, eais.ei-a6.medium.

NameRegex string

A regex string to filter results by Instance name.

OutputFile string
Status string

The status of the resource. Valid values: Attaching, Available, Detaching, InUse, Starting, Unavailable.

ids List

A list of Instance IDs.

instanceType String

The type of the resource. Valid values: eais.ei-a6.4xlarge, eais.ei-a6.2xlarge, eais.ei-a6.xlarge, eais.ei-a6.large, eais.ei-a6.medium.

nameRegex String

A regex string to filter results by Instance name.

outputFile String
status String

The status of the resource. Valid values: Attaching, Available, Detaching, InUse, Starting, Unavailable.

ids string[]

A list of Instance IDs.

instanceType string

The type of the resource. Valid values: eais.ei-a6.4xlarge, eais.ei-a6.2xlarge, eais.ei-a6.xlarge, eais.ei-a6.large, eais.ei-a6.medium.

nameRegex string

A regex string to filter results by Instance name.

outputFile string
status string

The status of the resource. Valid values: Attaching, Available, Detaching, InUse, Starting, Unavailable.

ids Sequence[str]

A list of Instance IDs.

instance_type str

The type of the resource. Valid values: eais.ei-a6.4xlarge, eais.ei-a6.2xlarge, eais.ei-a6.xlarge, eais.ei-a6.large, eais.ei-a6.medium.

name_regex str

A regex string to filter results by Instance name.

output_file str
status str

The status of the resource. Valid values: Attaching, Available, Detaching, InUse, Starting, Unavailable.

ids List

A list of Instance IDs.

instanceType String

The type of the resource. Valid values: eais.ei-a6.4xlarge, eais.ei-a6.2xlarge, eais.ei-a6.xlarge, eais.ei-a6.large, eais.ei-a6.medium.

nameRegex String

A regex string to filter results by Instance name.

outputFile String
status String

The status of the resource. Valid values: Attaching, Available, Detaching, InUse, Starting, Unavailable.

getInstances Result

The following output properties are available:

Id string

The provider-assigned unique ID for this managed resource.

Ids List<string>
Instances List<Pulumi.AliCloud.Eais.Outputs.GetInstancesInstance>
Names List<string>
InstanceType string
NameRegex string
OutputFile string
Status string
Id string

The provider-assigned unique ID for this managed resource.

Ids []string
Instances []GetInstancesInstance
Names []string
InstanceType string
NameRegex string
OutputFile string
Status string
id String

The provider-assigned unique ID for this managed resource.

ids List
instances ListInstancesInstance>
names List
instanceType String
nameRegex String
outputFile String
status String
id string

The provider-assigned unique ID for this managed resource.

ids string[]
instances GetInstancesInstance[]
names string[]
instanceType string
nameRegex string
outputFile string
status string
id str

The provider-assigned unique ID for this managed resource.

ids Sequence[str]
instances Sequence[GetInstancesInstance]
names Sequence[str]
instance_type str
name_regex str
output_file str
status str
id String

The provider-assigned unique ID for this managed resource.

ids List
instances List
names List
instanceType String
nameRegex String
outputFile String
status String

Supporting Types

GetInstancesInstance

ClientInstanceId string

The ID of the ECS instance to be bound.

ClientInstanceName string

The name of the ECS instance bound to the EAIS instance.

ClientInstanceType string

The type of the ECS instance bound to the EAIS instance.

Id string

The ID of the Instance.

InstanceId string

The ID of the resource.

InstanceName string

The name of the resource.

InstanceType string

The type of the resource. Valid values: eais.ei-a6.4xlarge, eais.ei-a6.2xlarge, eais.ei-a6.xlarge, eais.ei-a6.large, eais.ei-a6.medium.

Status string

The status of the resource. Valid values: Attaching, Available, Detaching, InUse, Starting, Unavailable.

ZoneId string

The ID of the region to which the EAIS instance belongs.

ClientInstanceId string

The ID of the ECS instance to be bound.

ClientInstanceName string

The name of the ECS instance bound to the EAIS instance.

ClientInstanceType string

The type of the ECS instance bound to the EAIS instance.

Id string

The ID of the Instance.

InstanceId string

The ID of the resource.

InstanceName string

The name of the resource.

InstanceType string

The type of the resource. Valid values: eais.ei-a6.4xlarge, eais.ei-a6.2xlarge, eais.ei-a6.xlarge, eais.ei-a6.large, eais.ei-a6.medium.

Status string

The status of the resource. Valid values: Attaching, Available, Detaching, InUse, Starting, Unavailable.

ZoneId string

The ID of the region to which the EAIS instance belongs.

clientInstanceId String

The ID of the ECS instance to be bound.

clientInstanceName String

The name of the ECS instance bound to the EAIS instance.

clientInstanceType String

The type of the ECS instance bound to the EAIS instance.

id String

The ID of the Instance.

instanceId String

The ID of the resource.

instanceName String

The name of the resource.

instanceType String

The type of the resource. Valid values: eais.ei-a6.4xlarge, eais.ei-a6.2xlarge, eais.ei-a6.xlarge, eais.ei-a6.large, eais.ei-a6.medium.

status String

The status of the resource. Valid values: Attaching, Available, Detaching, InUse, Starting, Unavailable.

zoneId String

The ID of the region to which the EAIS instance belongs.

clientInstanceId string

The ID of the ECS instance to be bound.

clientInstanceName string

The name of the ECS instance bound to the EAIS instance.

clientInstanceType string

The type of the ECS instance bound to the EAIS instance.

id string

The ID of the Instance.

instanceId string

The ID of the resource.

instanceName string

The name of the resource.

instanceType string

The type of the resource. Valid values: eais.ei-a6.4xlarge, eais.ei-a6.2xlarge, eais.ei-a6.xlarge, eais.ei-a6.large, eais.ei-a6.medium.

status string

The status of the resource. Valid values: Attaching, Available, Detaching, InUse, Starting, Unavailable.

zoneId string

The ID of the region to which the EAIS instance belongs.

client_instance_id str

The ID of the ECS instance to be bound.

client_instance_name str

The name of the ECS instance bound to the EAIS instance.

client_instance_type str

The type of the ECS instance bound to the EAIS instance.

id str

The ID of the Instance.

instance_id str

The ID of the resource.

instance_name str

The name of the resource.

instance_type str

The type of the resource. Valid values: eais.ei-a6.4xlarge, eais.ei-a6.2xlarge, eais.ei-a6.xlarge, eais.ei-a6.large, eais.ei-a6.medium.

status str

The status of the resource. Valid values: Attaching, Available, Detaching, InUse, Starting, Unavailable.

zone_id str

The ID of the region to which the EAIS instance belongs.

clientInstanceId String

The ID of the ECS instance to be bound.

clientInstanceName String

The name of the ECS instance bound to the EAIS instance.

clientInstanceType String

The type of the ECS instance bound to the EAIS instance.

id String

The ID of the Instance.

instanceId String

The ID of the resource.

instanceName String

The name of the resource.

instanceType String

The type of the resource. Valid values: eais.ei-a6.4xlarge, eais.ei-a6.2xlarge, eais.ei-a6.xlarge, eais.ei-a6.large, eais.ei-a6.medium.

status String

The status of the resource. Valid values: Attaching, Available, Detaching, InUse, Starting, Unavailable.

zoneId String

The ID of the region to which the EAIS instance belongs.

Package Details

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

This Pulumi package is based on the alicloud Terraform Provider.