Alibaba Cloud

Pulumi Official
Package maintained by Pulumi
v3.26.0 published on Friday, Jul 29, 2022 by Pulumi

getInstances

The Instances data source list ECS instance resources according to their ID, name regex, image id, status and other fields.

Example Usage

using Pulumi;
using AliCloud = Pulumi.AliCloud;

class MyStack : Stack
{
    public MyStack()
    {
        var instancesDs = Output.Create(AliCloud.Ecs.GetInstances.InvokeAsync(new AliCloud.Ecs.GetInstancesArgs
        {
            NameRegex = "web_server",
            Status = "Running",
        }));
        this.FirstInstanceId = instancesDs.Apply(instancesDs => instancesDs.Instances?[0]?.Id);
        this.InstanceIds = instancesDs.Apply(instancesDs => instancesDs.Ids);
    }

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

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

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		instancesDs, err := ecs.GetInstances(ctx, &ecs.GetInstancesArgs{
			NameRegex: pulumi.StringRef("web_server"),
			Status:    pulumi.StringRef("Running"),
		}, nil)
		if err != nil {
			return err
		}
		ctx.Export("firstInstanceId", instancesDs.Instances[0].Id)
		ctx.Export("instanceIds", instancesDs.Ids)
		return nil
	})
}

Coming soon!

import pulumi
import pulumi_alicloud as alicloud

instances_ds = alicloud.ecs.get_instances(name_regex="web_server",
    status="Running")
pulumi.export("firstInstanceId", instances_ds.instances[0].id)
pulumi.export("instanceIds", instances_ds.ids)
import * as pulumi from "@pulumi/pulumi";
import * as alicloud from "@pulumi/alicloud";

const instancesDs = pulumi.output(alicloud.ecs.getInstances({
    nameRegex: "web_server",
    status: "Running",
}));

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

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,
                  image_id: Optional[str] = None,
                  name_regex: Optional[str] = None,
                  output_file: Optional[str] = None,
                  page_number: Optional[int] = None,
                  page_size: Optional[int] = None,
                  ram_role_name: Optional[str] = None,
                  resource_group_id: Optional[str] = None,
                  status: Optional[str] = None,
                  tags: Optional[Mapping[str, Any]] = None,
                  vpc_id: Optional[str] = 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,
                  image_id: Optional[pulumi.Input[str]] = None,
                  name_regex: Optional[pulumi.Input[str]] = None,
                  output_file: Optional[pulumi.Input[str]] = None,
                  page_number: Optional[pulumi.Input[int]] = None,
                  page_size: Optional[pulumi.Input[int]] = None,
                  ram_role_name: Optional[pulumi.Input[str]] = None,
                  resource_group_id: Optional[pulumi.Input[str]] = None,
                  status: Optional[pulumi.Input[str]] = None,
                  tags: Optional[pulumi.Input[Mapping[str, Any]]] = None,
                  vpc_id: Optional[pulumi.Input[str]] = 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:ecs/getInstances:getInstances
  Arguments:
    # Arguments dictionary

The following arguments are supported:

AvailabilityZone string

Availability zone where instances are located.

Ids List<string>

A list of ECS instance IDs.

ImageId string

The image ID of some ECS instance used.

NameRegex string

A regex string to filter results by instance name.

OutputFile string
PageNumber int
PageSize int
RamRoleName string

The RAM role name which the instance attaches.

ResourceGroupId string

The Id of resource group which the instance belongs.

Status string

Instance status. Valid values: "Creating", "Starting", "Running", "Stopping" and "Stopped". If undefined, all statuses are considered.

Tags Dictionary<string, object>

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

import * as pulumi from "@pulumi/pulumi";
import * as alicloud from "@pulumi/alicloud";

const taggedInstances = pulumi.output(alicloud.ecs.getInstances({ tags: { tagKey1: "tagValue1", tagKey2: "tagValue2", }, }));

import pulumi
import pulumi_alicloud as alicloud

tagged_instances = alicloud.ecs.get_instances(tags={
    "tagKey1": "tagValue1",
    "tagKey2": "tagValue2",
})
using Pulumi;
using AliCloud = Pulumi.AliCloud;

class MyStack : Stack
{
    public MyStack()
    {
        var taggedInstances = Output.Create(AliCloud.Ecs.GetInstances.InvokeAsync(new AliCloud.Ecs.GetInstancesArgs
        {
            Tags = 
            {
                { "tagKey1", "tagValue1" },
                { "tagKey2", "tagValue2" },
            },
        }));
    }

}
package main

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

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := ecs.GetInstances(ctx, &ecs.GetInstancesArgs{
			Tags: map[string]interface{}{
				"tagKey1": "tagValue1",
				"tagKey2": "tagValue2",
			},
		}, nil)
		if err != nil {
			return err
		}
		return nil
	})
}
VpcId string

ID of the VPC linked to the instances.

VswitchId string

ID of the VSwitch linked to the instances.

AvailabilityZone string

Availability zone where instances are located.

Ids []string

A list of ECS instance IDs.

ImageId string

The image ID of some ECS instance used.

NameRegex string

A regex string to filter results by instance name.

OutputFile string
PageNumber int
PageSize int
RamRoleName string

The RAM role name which the instance attaches.

ResourceGroupId string

The Id of resource group which the instance belongs.

Status string

Instance status. Valid values: "Creating", "Starting", "Running", "Stopping" and "Stopped". If undefined, all statuses are considered.

Tags map[string]interface{}

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

import * as pulumi from "@pulumi/pulumi";
import * as alicloud from "@pulumi/alicloud";

const taggedInstances = pulumi.output(alicloud.ecs.getInstances({ tags: { tagKey1: "tagValue1", tagKey2: "tagValue2", }, }));

import pulumi
import pulumi_alicloud as alicloud

tagged_instances = alicloud.ecs.get_instances(tags={
    "tagKey1": "tagValue1",
    "tagKey2": "tagValue2",
})
using Pulumi;
using AliCloud = Pulumi.AliCloud;

class MyStack : Stack
{
    public MyStack()
    {
        var taggedInstances = Output.Create(AliCloud.Ecs.GetInstances.InvokeAsync(new AliCloud.Ecs.GetInstancesArgs
        {
            Tags = 
            {
                { "tagKey1", "tagValue1" },
                { "tagKey2", "tagValue2" },
            },
        }));
    }

}
package main

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

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := ecs.GetInstances(ctx, &ecs.GetInstancesArgs{
			Tags: map[string]interface{}{
				"tagKey1": "tagValue1",
				"tagKey2": "tagValue2",
			},
		}, nil)
		if err != nil {
			return err
		}
		return nil
	})
}
VpcId string

ID of the VPC linked to the instances.

VswitchId string

ID of the VSwitch linked to the instances.

availabilityZone String

Availability zone where instances are located.

ids List<String>

A list of ECS instance IDs.

imageId String

The image ID of some ECS instance used.

nameRegex String

A regex string to filter results by instance name.

outputFile String
pageNumber Integer
pageSize Integer
ramRoleName String

The RAM role name which the instance attaches.

resourceGroupId String

The Id of resource group which the instance belongs.

status String

Instance status. Valid values: "Creating", "Starting", "Running", "Stopping" and "Stopped". If undefined, all statuses are considered.

tags Map<String,Object>

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

import * as pulumi from "@pulumi/pulumi";
import * as alicloud from "@pulumi/alicloud";

const taggedInstances = pulumi.output(alicloud.ecs.getInstances({ tags: { tagKey1: "tagValue1", tagKey2: "tagValue2", }, }));

import pulumi
import pulumi_alicloud as alicloud

tagged_instances = alicloud.ecs.get_instances(tags={
    "tagKey1": "tagValue1",
    "tagKey2": "tagValue2",
})
using Pulumi;
using AliCloud = Pulumi.AliCloud;

class MyStack : Stack
{
    public MyStack()
    {
        var taggedInstances = Output.Create(AliCloud.Ecs.GetInstances.InvokeAsync(new AliCloud.Ecs.GetInstancesArgs
        {
            Tags = 
            {
                { "tagKey1", "tagValue1" },
                { "tagKey2", "tagValue2" },
            },
        }));
    }

}
package main

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

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := ecs.GetInstances(ctx, &ecs.GetInstancesArgs{
			Tags: map[string]interface{}{
				"tagKey1": "tagValue1",
				"tagKey2": "tagValue2",
			},
		}, nil)
		if err != nil {
			return err
		}
		return nil
	})
}
vpcId String

ID of the VPC linked to the instances.

vswitchId String

ID of the VSwitch linked to the instances.

availabilityZone string

Availability zone where instances are located.

ids string[]

A list of ECS instance IDs.

imageId string

The image ID of some ECS instance used.

nameRegex string

A regex string to filter results by instance name.

outputFile string
pageNumber number
pageSize number
ramRoleName string

The RAM role name which the instance attaches.

resourceGroupId string

The Id of resource group which the instance belongs.

status string

Instance status. Valid values: "Creating", "Starting", "Running", "Stopping" and "Stopped". If undefined, all statuses are considered.

tags {[key: string]: any}

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

import * as pulumi from "@pulumi/pulumi";
import * as alicloud from "@pulumi/alicloud";

const taggedInstances = pulumi.output(alicloud.ecs.getInstances({ tags: { tagKey1: "tagValue1", tagKey2: "tagValue2", }, }));

import pulumi
import pulumi_alicloud as alicloud

tagged_instances = alicloud.ecs.get_instances(tags={
    "tagKey1": "tagValue1",
    "tagKey2": "tagValue2",
})
using Pulumi;
using AliCloud = Pulumi.AliCloud;

class MyStack : Stack
{
    public MyStack()
    {
        var taggedInstances = Output.Create(AliCloud.Ecs.GetInstances.InvokeAsync(new AliCloud.Ecs.GetInstancesArgs
        {
            Tags = 
            {
                { "tagKey1", "tagValue1" },
                { "tagKey2", "tagValue2" },
            },
        }));
    }

}
package main

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

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := ecs.GetInstances(ctx, &ecs.GetInstancesArgs{
			Tags: map[string]interface{}{
				"tagKey1": "tagValue1",
				"tagKey2": "tagValue2",
			},
		}, nil)
		if err != nil {
			return err
		}
		return nil
	})
}
vpcId string

ID of the VPC linked to the instances.

vswitchId string

ID of the VSwitch linked to the instances.

availability_zone str

Availability zone where instances are located.

ids Sequence[str]

A list of ECS instance IDs.

image_id str

The image ID of some ECS instance used.

name_regex str

A regex string to filter results by instance name.

output_file str
page_number int
page_size int
ram_role_name str

The RAM role name which the instance attaches.

resource_group_id str

The Id of resource group which the instance belongs.

status str

Instance status. Valid values: "Creating", "Starting", "Running", "Stopping" and "Stopped". If undefined, all statuses are considered.

tags Mapping[str, Any]

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

import * as pulumi from "@pulumi/pulumi";
import * as alicloud from "@pulumi/alicloud";

const taggedInstances = pulumi.output(alicloud.ecs.getInstances({ tags: { tagKey1: "tagValue1", tagKey2: "tagValue2", }, }));

import pulumi
import pulumi_alicloud as alicloud

tagged_instances = alicloud.ecs.get_instances(tags={
    "tagKey1": "tagValue1",
    "tagKey2": "tagValue2",
})
using Pulumi;
using AliCloud = Pulumi.AliCloud;

class MyStack : Stack
{
    public MyStack()
    {
        var taggedInstances = Output.Create(AliCloud.Ecs.GetInstances.InvokeAsync(new AliCloud.Ecs.GetInstancesArgs
        {
            Tags = 
            {
                { "tagKey1", "tagValue1" },
                { "tagKey2", "tagValue2" },
            },
        }));
    }

}
package main

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

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := ecs.GetInstances(ctx, &ecs.GetInstancesArgs{
			Tags: map[string]interface{}{
				"tagKey1": "tagValue1",
				"tagKey2": "tagValue2",
			},
		}, nil)
		if err != nil {
			return err
		}
		return nil
	})
}
vpc_id str

ID of the VPC linked to the instances.

vswitch_id str

ID of the VSwitch linked to the instances.

availabilityZone String

Availability zone where instances are located.

ids List<String>

A list of ECS instance IDs.

imageId String

The image ID of some ECS instance used.

nameRegex String

A regex string to filter results by instance name.

outputFile String
pageNumber Number
pageSize Number
ramRoleName String

The RAM role name which the instance attaches.

resourceGroupId String

The Id of resource group which the instance belongs.

status String

Instance status. Valid values: "Creating", "Starting", "Running", "Stopping" and "Stopped". If undefined, all statuses are considered.

tags Map<Any>

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

import * as pulumi from "@pulumi/pulumi";
import * as alicloud from "@pulumi/alicloud";

const taggedInstances = pulumi.output(alicloud.ecs.getInstances({ tags: { tagKey1: "tagValue1", tagKey2: "tagValue2", }, }));

import pulumi
import pulumi_alicloud as alicloud

tagged_instances = alicloud.ecs.get_instances(tags={
    "tagKey1": "tagValue1",
    "tagKey2": "tagValue2",
})
using Pulumi;
using AliCloud = Pulumi.AliCloud;

class MyStack : Stack
{
    public MyStack()
    {
        var taggedInstances = Output.Create(AliCloud.Ecs.GetInstances.InvokeAsync(new AliCloud.Ecs.GetInstancesArgs
        {
            Tags = 
            {
                { "tagKey1", "tagValue1" },
                { "tagKey2", "tagValue2" },
            },
        }));
    }

}
package main

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

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := ecs.GetInstances(ctx, &ecs.GetInstancesArgs{
			Tags: map[string]interface{}{
				"tagKey1": "tagValue1",
				"tagKey2": "tagValue2",
			},
		}, nil)
		if err != nil {
			return err
		}
		return nil
	})
}
vpcId String

ID of the VPC linked to the instances.

vswitchId String

ID of the VSwitch linked to the instances.

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

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

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

Names List<string>

A list of instances names.

TotalCount int
AvailabilityZone string

Availability zone the instance belongs to.

ImageId string

Image ID the instance is using.

NameRegex string
OutputFile string
PageNumber int
PageSize int
RamRoleName string

The Ram role name.

ResourceGroupId string

The Id of resource group.

Status string

Instance current status.

Tags Dictionary<string, object>

A map of tags assigned to the ECS instance.

VpcId string

ID of the VPC the instance belongs to.

VswitchId string

ID of the VSwitch the instance belongs to.

Id string

The provider-assigned unique ID for this managed resource.

Ids []string

A list of ECS instance IDs.

Instances []GetInstancesInstance

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

Names []string

A list of instances names.

TotalCount int
AvailabilityZone string

Availability zone the instance belongs to.

ImageId string

Image ID the instance is using.

NameRegex string
OutputFile string
PageNumber int
PageSize int
RamRoleName string

The Ram role name.

ResourceGroupId string

The Id of resource group.

Status string

Instance current status.

Tags map[string]interface{}

A map of tags assigned to the ECS instance.

VpcId string

ID of the VPC the instance belongs to.

VswitchId string

ID of the VSwitch the instance belongs to.

id String

The provider-assigned unique ID for this managed resource.

ids List<String>

A list of ECS instance IDs.

instances List<GetInstancesInstance>

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

names List<String>

A list of instances names.

totalCount Integer
availabilityZone String

Availability zone the instance belongs to.

imageId String

Image ID the instance is using.

nameRegex String
outputFile String
pageNumber Integer
pageSize Integer
ramRoleName String

The Ram role name.

resourceGroupId String

The Id of resource group.

status String

Instance current status.

tags Map<String,Object>

A map of tags assigned to the ECS instance.

vpcId String

ID of the VPC the instance belongs to.

vswitchId String

ID of the VSwitch the instance belongs to.

id string

The provider-assigned unique ID for this managed resource.

ids string[]

A list of ECS instance IDs.

instances GetInstancesInstance[]

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

names string[]

A list of instances names.

totalCount number
availabilityZone string

Availability zone the instance belongs to.

imageId string

Image ID the instance is using.

nameRegex string
outputFile string
pageNumber number
pageSize number
ramRoleName string

The Ram role name.

resourceGroupId string

The Id of resource group.

status string

Instance current status.

tags {[key: string]: any}

A map of tags assigned to the ECS instance.

vpcId string

ID of the VPC the instance belongs to.

vswitchId string

ID of the VSwitch the instance belongs to.

id str

The provider-assigned unique ID for this managed resource.

ids Sequence[str]

A list of ECS instance IDs.

instances Sequence[GetInstancesInstance]

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

names Sequence[str]

A list of instances names.

total_count int
availability_zone str

Availability zone the instance belongs to.

image_id str

Image ID the instance is using.

name_regex str
output_file str
page_number int
page_size int
ram_role_name str

The Ram role name.

resource_group_id str

The Id of resource group.

status str

Instance current status.

tags Mapping[str, Any]

A map of tags assigned to the ECS instance.

vpc_id str

ID of the VPC the instance belongs to.

vswitch_id str

ID of the VSwitch the instance belongs to.

id String

The provider-assigned unique ID for this managed resource.

ids List<String>

A list of ECS instance IDs.

instances List<Property Map>

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

names List<String>

A list of instances names.

totalCount Number
availabilityZone String

Availability zone the instance belongs to.

imageId String

Image ID the instance is using.

nameRegex String
outputFile String
pageNumber Number
pageSize Number
ramRoleName String

The Ram role name.

resourceGroupId String

The Id of resource group.

status String

Instance current status.

tags Map<Any>

A map of tags assigned to the ECS instance.

vpcId String

ID of the VPC the instance belongs to.

vswitchId String

ID of the VSwitch the instance belongs to.

Supporting Types

GetInstancesInstance

AvailabilityZone string

Availability zone where instances are located.

CreationTime string

Instance creation time.

Description string

Instance description.

DiskDeviceMappings List<Pulumi.AliCloud.Ecs.Inputs.GetInstancesInstanceDiskDeviceMapping>

Description of the attached disks.

Eip string

EIP address the VPC instance is using.

Id string

ID of the instance.

ImageId string

The image ID of some ECS instance used.

InstanceChargeType string

Instance charge type.

InstanceType string

Instance type.

InternetChargeType string

Instance network charge type.

InternetMaxBandwidthOut int

Max output bandwidth for internet.

KeyName string

Key pair the instance is using.

Name string

Instance name.

PrivateIp string

Instance private IP address.

PublicIp string

Instance public IP address.

RamRoleName string

The RAM role name which the instance attaches.

RegionId string

Region ID the instance belongs to.

ResourceGroupId string

The Id of resource group which the instance belongs.

SecurityGroups List<string>

List of security group IDs the instance belongs to.

SpotStrategy string

Spot strategy the instance is using.

Status string

Instance status. Valid values: "Creating", "Starting", "Running", "Stopping" and "Stopped". If undefined, all statuses are considered.

VpcId string

ID of the VPC linked to the instances.

VswitchId string

ID of the VSwitch linked to the instances.

Tags Dictionary<string, object>

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

import * as pulumi from "@pulumi/pulumi";
import * as alicloud from "@pulumi/alicloud";

const taggedInstances = pulumi.output(alicloud.ecs.getInstances({ tags: { tagKey1: "tagValue1", tagKey2: "tagValue2", }, }));

import pulumi
import pulumi_alicloud as alicloud

tagged_instances = alicloud.ecs.get_instances(tags={
    "tagKey1": "tagValue1",
    "tagKey2": "tagValue2",
})
using Pulumi;
using AliCloud = Pulumi.AliCloud;

class MyStack : Stack
{
    public MyStack()
    {
        var taggedInstances = Output.Create(AliCloud.Ecs.GetInstances.InvokeAsync(new AliCloud.Ecs.GetInstancesArgs
        {
            Tags = 
            {
                { "tagKey1", "tagValue1" },
                { "tagKey2", "tagValue2" },
            },
        }));
    }

}
package main

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

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := ecs.GetInstances(ctx, &ecs.GetInstancesArgs{
			Tags: map[string]interface{}{
				"tagKey1": "tagValue1",
				"tagKey2": "tagValue2",
			},
		}, nil)
		if err != nil {
			return err
		}
		return nil
	})
}
AvailabilityZone string

Availability zone where instances are located.

CreationTime string

Instance creation time.

Description string

Instance description.

DiskDeviceMappings []GetInstancesInstanceDiskDeviceMapping

Description of the attached disks.

Eip string

EIP address the VPC instance is using.

Id string

ID of the instance.

ImageId string

The image ID of some ECS instance used.

InstanceChargeType string

Instance charge type.

InstanceType string

Instance type.

InternetChargeType string

Instance network charge type.

InternetMaxBandwidthOut int

Max output bandwidth for internet.

KeyName string

Key pair the instance is using.

Name string

Instance name.

PrivateIp string

Instance private IP address.

PublicIp string

Instance public IP address.

RamRoleName string

The RAM role name which the instance attaches.

RegionId string

Region ID the instance belongs to.

ResourceGroupId string

The Id of resource group which the instance belongs.

SecurityGroups []string

List of security group IDs the instance belongs to.

SpotStrategy string

Spot strategy the instance is using.

Status string

Instance status. Valid values: "Creating", "Starting", "Running", "Stopping" and "Stopped". If undefined, all statuses are considered.

VpcId string

ID of the VPC linked to the instances.

VswitchId string

ID of the VSwitch linked to the instances.

Tags map[string]interface{}

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

import * as pulumi from "@pulumi/pulumi";
import * as alicloud from "@pulumi/alicloud";

const taggedInstances = pulumi.output(alicloud.ecs.getInstances({ tags: { tagKey1: "tagValue1", tagKey2: "tagValue2", }, }));

import pulumi
import pulumi_alicloud as alicloud

tagged_instances = alicloud.ecs.get_instances(tags={
    "tagKey1": "tagValue1",
    "tagKey2": "tagValue2",
})
using Pulumi;
using AliCloud = Pulumi.AliCloud;

class MyStack : Stack
{
    public MyStack()
    {
        var taggedInstances = Output.Create(AliCloud.Ecs.GetInstances.InvokeAsync(new AliCloud.Ecs.GetInstancesArgs
        {
            Tags = 
            {
                { "tagKey1", "tagValue1" },
                { "tagKey2", "tagValue2" },
            },
        }));
    }

}
package main

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

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := ecs.GetInstances(ctx, &ecs.GetInstancesArgs{
			Tags: map[string]interface{}{
				"tagKey1": "tagValue1",
				"tagKey2": "tagValue2",
			},
		}, nil)
		if err != nil {
			return err
		}
		return nil
	})
}
availabilityZone String

Availability zone where instances are located.

creationTime String

Instance creation time.

description String

Instance description.

diskDeviceMappings List<GetInstancesInstanceDiskDeviceMapping>

Description of the attached disks.

eip String

EIP address the VPC instance is using.

id String

ID of the instance.

imageId String

The image ID of some ECS instance used.

instanceChargeType String

Instance charge type.

instanceType String

Instance type.

internetChargeType String

Instance network charge type.

internetMaxBandwidthOut Integer

Max output bandwidth for internet.

keyName String

Key pair the instance is using.

name String

Instance name.

privateIp String

Instance private IP address.

publicIp String

Instance public IP address.

ramRoleName String

The RAM role name which the instance attaches.

regionId String

Region ID the instance belongs to.

resourceGroupId String

The Id of resource group which the instance belongs.

securityGroups List<String>

List of security group IDs the instance belongs to.

spotStrategy String

Spot strategy the instance is using.

status String

Instance status. Valid values: "Creating", "Starting", "Running", "Stopping" and "Stopped". If undefined, all statuses are considered.

vpcId String

ID of the VPC linked to the instances.

vswitchId String

ID of the VSwitch linked to the instances.

tags Map<String,Object>

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

import * as pulumi from "@pulumi/pulumi";
import * as alicloud from "@pulumi/alicloud";

const taggedInstances = pulumi.output(alicloud.ecs.getInstances({ tags: { tagKey1: "tagValue1", tagKey2: "tagValue2", }, }));

import pulumi
import pulumi_alicloud as alicloud

tagged_instances = alicloud.ecs.get_instances(tags={
    "tagKey1": "tagValue1",
    "tagKey2": "tagValue2",
})
using Pulumi;
using AliCloud = Pulumi.AliCloud;

class MyStack : Stack
{
    public MyStack()
    {
        var taggedInstances = Output.Create(AliCloud.Ecs.GetInstances.InvokeAsync(new AliCloud.Ecs.GetInstancesArgs
        {
            Tags = 
            {
                { "tagKey1", "tagValue1" },
                { "tagKey2", "tagValue2" },
            },
        }));
    }

}
package main

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

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := ecs.GetInstances(ctx, &ecs.GetInstancesArgs{
			Tags: map[string]interface{}{
				"tagKey1": "tagValue1",
				"tagKey2": "tagValue2",
			},
		}, nil)
		if err != nil {
			return err
		}
		return nil
	})
}
availabilityZone string

Availability zone where instances are located.

creationTime string

Instance creation time.

description string

Instance description.

diskDeviceMappings GetInstancesInstanceDiskDeviceMapping[]

Description of the attached disks.

eip string

EIP address the VPC instance is using.

id string

ID of the instance.

imageId string

The image ID of some ECS instance used.

instanceChargeType string

Instance charge type.

instanceType string

Instance type.

internetChargeType string

Instance network charge type.

internetMaxBandwidthOut number

Max output bandwidth for internet.

keyName string

Key pair the instance is using.

name string

Instance name.

privateIp string

Instance private IP address.

publicIp string

Instance public IP address.

ramRoleName string

The RAM role name which the instance attaches.

regionId string

Region ID the instance belongs to.

resourceGroupId string

The Id of resource group which the instance belongs.

securityGroups string[]

List of security group IDs the instance belongs to.

spotStrategy string

Spot strategy the instance is using.

status string

Instance status. Valid values: "Creating", "Starting", "Running", "Stopping" and "Stopped". If undefined, all statuses are considered.

vpcId string

ID of the VPC linked to the instances.

vswitchId string

ID of the VSwitch linked to the instances.

tags {[key: string]: any}

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

import * as pulumi from "@pulumi/pulumi";
import * as alicloud from "@pulumi/alicloud";

const taggedInstances = pulumi.output(alicloud.ecs.getInstances({ tags: { tagKey1: "tagValue1", tagKey2: "tagValue2", }, }));

import pulumi
import pulumi_alicloud as alicloud

tagged_instances = alicloud.ecs.get_instances(tags={
    "tagKey1": "tagValue1",
    "tagKey2": "tagValue2",
})
using Pulumi;
using AliCloud = Pulumi.AliCloud;

class MyStack : Stack
{
    public MyStack()
    {
        var taggedInstances = Output.Create(AliCloud.Ecs.GetInstances.InvokeAsync(new AliCloud.Ecs.GetInstancesArgs
        {
            Tags = 
            {
                { "tagKey1", "tagValue1" },
                { "tagKey2", "tagValue2" },
            },
        }));
    }

}
package main

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

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := ecs.GetInstances(ctx, &ecs.GetInstancesArgs{
			Tags: map[string]interface{}{
				"tagKey1": "tagValue1",
				"tagKey2": "tagValue2",
			},
		}, nil)
		if err != nil {
			return err
		}
		return nil
	})
}
availability_zone str

Availability zone where instances are located.

creation_time str

Instance creation time.

description str

Instance description.

disk_device_mappings Sequence[GetInstancesInstanceDiskDeviceMapping]

Description of the attached disks.

eip str

EIP address the VPC instance is using.

id str

ID of the instance.

image_id str

The image ID of some ECS instance used.

instance_charge_type str

Instance charge type.

instance_type str

Instance type.

internet_charge_type str

Instance network charge type.

internet_max_bandwidth_out int

Max output bandwidth for internet.

key_name str

Key pair the instance is using.

name str

Instance name.

private_ip str

Instance private IP address.

public_ip str

Instance public IP address.

ram_role_name str

The RAM role name which the instance attaches.

region_id str

Region ID the instance belongs to.

resource_group_id str

The Id of resource group which the instance belongs.

security_groups Sequence[str]

List of security group IDs the instance belongs to.

spot_strategy str

Spot strategy the instance is using.

status str

Instance status. Valid values: "Creating", "Starting", "Running", "Stopping" and "Stopped". If undefined, all statuses are considered.

vpc_id str

ID of the VPC linked to the instances.

vswitch_id str

ID of the VSwitch linked to the instances.

tags Mapping[str, Any]

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

import * as pulumi from "@pulumi/pulumi";
import * as alicloud from "@pulumi/alicloud";

const taggedInstances = pulumi.output(alicloud.ecs.getInstances({ tags: { tagKey1: "tagValue1", tagKey2: "tagValue2", }, }));

import pulumi
import pulumi_alicloud as alicloud

tagged_instances = alicloud.ecs.get_instances(tags={
    "tagKey1": "tagValue1",
    "tagKey2": "tagValue2",
})
using Pulumi;
using AliCloud = Pulumi.AliCloud;

class MyStack : Stack
{
    public MyStack()
    {
        var taggedInstances = Output.Create(AliCloud.Ecs.GetInstances.InvokeAsync(new AliCloud.Ecs.GetInstancesArgs
        {
            Tags = 
            {
                { "tagKey1", "tagValue1" },
                { "tagKey2", "tagValue2" },
            },
        }));
    }

}
package main

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

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := ecs.GetInstances(ctx, &ecs.GetInstancesArgs{
			Tags: map[string]interface{}{
				"tagKey1": "tagValue1",
				"tagKey2": "tagValue2",
			},
		}, nil)
		if err != nil {
			return err
		}
		return nil
	})
}
availabilityZone String

Availability zone where instances are located.

creationTime String

Instance creation time.

description String

Instance description.

diskDeviceMappings List<Property Map>

Description of the attached disks.

eip String

EIP address the VPC instance is using.

id String

ID of the instance.

imageId String

The image ID of some ECS instance used.

instanceChargeType String

Instance charge type.

instanceType String

Instance type.

internetChargeType String

Instance network charge type.

internetMaxBandwidthOut Number

Max output bandwidth for internet.

keyName String

Key pair the instance is using.

name String

Instance name.

privateIp String

Instance private IP address.

publicIp String

Instance public IP address.

ramRoleName String

The RAM role name which the instance attaches.

regionId String

Region ID the instance belongs to.

resourceGroupId String

The Id of resource group which the instance belongs.

securityGroups List<String>

List of security group IDs the instance belongs to.

spotStrategy String

Spot strategy the instance is using.

status String

Instance status. Valid values: "Creating", "Starting", "Running", "Stopping" and "Stopped". If undefined, all statuses are considered.

vpcId String

ID of the VPC linked to the instances.

vswitchId String

ID of the VSwitch linked to the instances.

tags Map<Any>

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

import * as pulumi from "@pulumi/pulumi";
import * as alicloud from "@pulumi/alicloud";

const taggedInstances = pulumi.output(alicloud.ecs.getInstances({ tags: { tagKey1: "tagValue1", tagKey2: "tagValue2", }, }));

import pulumi
import pulumi_alicloud as alicloud

tagged_instances = alicloud.ecs.get_instances(tags={
    "tagKey1": "tagValue1",
    "tagKey2": "tagValue2",
})
using Pulumi;
using AliCloud = Pulumi.AliCloud;

class MyStack : Stack
{
    public MyStack()
    {
        var taggedInstances = Output.Create(AliCloud.Ecs.GetInstances.InvokeAsync(new AliCloud.Ecs.GetInstancesArgs
        {
            Tags = 
            {
                { "tagKey1", "tagValue1" },
                { "tagKey2", "tagValue2" },
            },
        }));
    }

}
package main

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

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := ecs.GetInstances(ctx, &ecs.GetInstancesArgs{
			Tags: map[string]interface{}{
				"tagKey1": "tagValue1",
				"tagKey2": "tagValue2",
			},
		}, nil)
		if err != nil {
			return err
		}
		return nil
	})
}

GetInstancesInstanceDiskDeviceMapping

Category string

Cloud disk category.

Device string

Device information of the created disk: such as /dev/xvdb.

Size int

Size of the created disk.

Type string

Cloud disk type: system disk or data disk.

Category string

Cloud disk category.

Device string

Device information of the created disk: such as /dev/xvdb.

Size int

Size of the created disk.

Type string

Cloud disk type: system disk or data disk.

category String

Cloud disk category.

device String

Device information of the created disk: such as /dev/xvdb.

size Integer

Size of the created disk.

type String

Cloud disk type: system disk or data disk.

category string

Cloud disk category.

device string

Device information of the created disk: such as /dev/xvdb.

size number

Size of the created disk.

type string

Cloud disk type: system disk or data disk.

category str

Cloud disk category.

device str

Device information of the created disk: such as /dev/xvdb.

size int

Size of the created disk.

type str

Cloud disk type: system disk or data disk.

category String

Cloud disk category.

device String

Device information of the created disk: such as /dev/xvdb.

size Number

Size of the created disk.

type String

Cloud disk type: system disk or data disk.

Package Details

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

This Pulumi package is based on the alicloud Terraform Provider.