published on Saturday, Mar 14, 2026 by Pulumi
published on Saturday, Mar 14, 2026 by Pulumi
The Instances data source list ECS instance resources according to their ID, name regex, image id, status and other fields.
NOTE: Available since v1.7.0.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as alicloud from "@pulumi/alicloud";
const instancesDs = alicloud.ecs.getInstances({
nameRegex: "web_server",
status: "Running",
});
export const firstInstanceId = instancesDs.then(instancesDs => instancesDs.instances?.[0]?.id);
export const instanceIds = instancesDs.then(instancesDs => instancesDs.ids);
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)
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
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AliCloud = Pulumi.AliCloud;
return await Deployment.RunAsync(() =>
{
var instancesDs = AliCloud.Ecs.GetInstances.Invoke(new()
{
NameRegex = "web_server",
Status = "Running",
});
return new Dictionary<string, object?>
{
["firstInstanceId"] = instancesDs.Apply(getInstancesResult => getInstancesResult.Instances[0]?.Id),
["instanceIds"] = instancesDs.Apply(getInstancesResult => getInstancesResult.Ids),
};
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.alicloud.ecs.EcsFunctions;
import com.pulumi.alicloud.ecs.inputs.GetInstancesArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
final var instancesDs = EcsFunctions.getInstances(GetInstancesArgs.builder()
.nameRegex("web_server")
.status("Running")
.build());
ctx.export("firstInstanceId", instancesDs.instances()[0].id());
ctx.export("instanceIds", instancesDs.ids());
}
}
variables:
instancesDs:
fn::invoke:
function: alicloud:ecs:getInstances
arguments:
nameRegex: web_server
status: Running
outputs:
firstInstanceId: ${instancesDs.instances[0].id}
instanceIds: ${instancesDs.ids}
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,
enable_details: Optional[bool] = None,
ids: Optional[Sequence[str]] = None,
image_id: Optional[str] = None,
instance_name: 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, str]] = 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,
enable_details: Optional[pulumi.Input[bool]] = None,
ids: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
image_id: Optional[pulumi.Input[str]] = None,
instance_name: 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, pulumi.Input[str]]]] = 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)
public static Output<GetInstancesResult> getInstances(GetInstancesArgs args, InvokeOptions options)
fn::invoke:
function: alicloud:ecs/getInstances:getInstances
arguments:
# arguments dictionaryThe following arguments are supported:
- Availability
Zone string - Availability zone where instances are located.
- Enable
Details bool - Default to
true. If false, the attributesram_role_nameanddisk_device_mappingswill not be fetched and output. - Ids List<string>
- A list of ECS instance IDs.
- Image
Id string - The image ID of some ECS instance used.
- Instance
Name string - The name of the instance. Fuzzy search with the asterisk (*) wildcard characters is supported.
- Name
Regex string - A regex string to filter results by instance name.
- Output
File string - File name where to save data source results (after running
pulumi preview). - Page
Number int - Page
Size int - Ram
Role stringName - The RAM role name which the instance attaches.
- Resource
Group stringId - 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.
- Dictionary<string, string>
- 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 = 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 System.Collections.Generic; using System.Linq; using Pulumi; using AliCloud = Pulumi.AliCloud; return await Deployment.RunAsync(() => { var taggedInstances = AliCloud.Ecs.GetInstances.Invoke(new() { 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 }) }package generated_program; import com.pulumi.Context; import com.pulumi.Pulumi; import com.pulumi.core.Output; import com.pulumi.alicloud.ecs.EcsFunctions; import com.pulumi.alicloud.ecs.inputs.GetInstancesArgs; import java.util.List; import java.util.ArrayList; import java.util.Map; import java.io.File; import java.nio.file.Files; import java.nio.file.Paths; public class App { public static void main(String[] args) { Pulumi.run(App::stack); } public static void stack(Context ctx) { final var taggedInstances = EcsFunctions.getInstances(GetInstancesArgs.builder() .tags(Map.ofEntries( Map.entry("tagKey1", "tagValue1"), Map.entry("tagKey2", "tagValue2") )) .build()); } }variables: taggedInstances: fn::invoke: function: alicloud:ecs:getInstances arguments: tags: tagKey1: tagValue1 tagKey2: tagValue2 title="Optional"> <span id="vpcid_csharp">Vpc
Id string- ID of the VPC linked to the instances.
- Vswitch
Id string - ID of the vSwitch linked to the instances.
- Availability
Zone string - Availability zone where instances are located.
- Enable
Details bool - Default to
true. If false, the attributesram_role_nameanddisk_device_mappingswill not be fetched and output. - Ids []string
- A list of ECS instance IDs.
- Image
Id string - The image ID of some ECS instance used.
- Instance
Name string - The name of the instance. Fuzzy search with the asterisk (*) wildcard characters is supported.
- Name
Regex string - A regex string to filter results by instance name.
- Output
File string - File name where to save data source results (after running
pulumi preview). - Page
Number int - Page
Size int - Ram
Role stringName - The RAM role name which the instance attaches.
- Resource
Group stringId - 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.
- map[string]string
- 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 = 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 System.Collections.Generic; using System.Linq; using Pulumi; using AliCloud = Pulumi.AliCloud; return await Deployment.RunAsync(() => { var taggedInstances = AliCloud.Ecs.GetInstances.Invoke(new() { 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 }) }package generated_program; import com.pulumi.Context; import com.pulumi.Pulumi; import com.pulumi.core.Output; import com.pulumi.alicloud.ecs.EcsFunctions; import com.pulumi.alicloud.ecs.inputs.GetInstancesArgs; import java.util.List; import java.util.ArrayList; import java.util.Map; import java.io.File; import java.nio.file.Files; import java.nio.file.Paths; public class App { public static void main(String[] args) { Pulumi.run(App::stack); } public static void stack(Context ctx) { final var taggedInstances = EcsFunctions.getInstances(GetInstancesArgs.builder() .tags(Map.ofEntries( Map.entry("tagKey1", "tagValue1"), Map.entry("tagKey2", "tagValue2") )) .build()); } }variables: taggedInstances: fn::invoke: function: alicloud:ecs:getInstances arguments: tags: tagKey1: tagValue1 tagKey2: tagValue2 title="Optional"> <span id="vpcid_go">Vpc
Id string- ID of the VPC linked to the instances.
- Vswitch
Id string - ID of the vSwitch linked to the instances.
- availability
Zone String - Availability zone where instances are located.
- enable
Details Boolean - Default to
true. If false, the attributesram_role_nameanddisk_device_mappingswill not be fetched and output. - ids List<String>
- A list of ECS instance IDs.
- image
Id String - The image ID of some ECS instance used.
- instance
Name String - The name of the instance. Fuzzy search with the asterisk (*) wildcard characters is supported.
- name
Regex String - A regex string to filter results by instance name.
- output
File String - File name where to save data source results (after running
pulumi preview). - page
Number Integer - page
Size Integer - ram
Role StringName - The RAM role name which the instance attaches.
- resource
Group StringId - 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.
- Map<String,String>
- 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 = 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 System.Collections.Generic; using System.Linq; using Pulumi; using AliCloud = Pulumi.AliCloud; return await Deployment.RunAsync(() => { var taggedInstances = AliCloud.Ecs.GetInstances.Invoke(new() { 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 }) }package generated_program; import com.pulumi.Context; import com.pulumi.Pulumi; import com.pulumi.core.Output; import com.pulumi.alicloud.ecs.EcsFunctions; import com.pulumi.alicloud.ecs.inputs.GetInstancesArgs; import java.util.List; import java.util.ArrayList; import java.util.Map; import java.io.File; import java.nio.file.Files; import java.nio.file.Paths; public class App { public static void main(String[] args) { Pulumi.run(App::stack); } public static void stack(Context ctx) { final var taggedInstances = EcsFunctions.getInstances(GetInstancesArgs.builder() .tags(Map.ofEntries( Map.entry("tagKey1", "tagValue1"), Map.entry("tagKey2", "tagValue2") )) .build()); } }variables: taggedInstances: fn::invoke: function: alicloud:ecs:getInstances arguments: tags: tagKey1: tagValue1 tagKey2: tagValue2 title="Optional"> <span id="vpcid_java">vpc
Id String- ID of the VPC linked to the instances.
- vswitch
Id String - ID of the vSwitch linked to the instances.
- availability
Zone string - Availability zone where instances are located.
- enable
Details boolean - Default to
true. If false, the attributesram_role_nameanddisk_device_mappingswill not be fetched and output. - ids string[]
- A list of ECS instance IDs.
- image
Id string - The image ID of some ECS instance used.
- instance
Name string - The name of the instance. Fuzzy search with the asterisk (*) wildcard characters is supported.
- name
Regex string - A regex string to filter results by instance name.
- output
File string - File name where to save data source results (after running
pulumi preview). - page
Number number - page
Size number - ram
Role stringName - The RAM role name which the instance attaches.
- resource
Group stringId - 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.
- {[key: string]: string}
- 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 = 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 System.Collections.Generic; using System.Linq; using Pulumi; using AliCloud = Pulumi.AliCloud; return await Deployment.RunAsync(() => { var taggedInstances = AliCloud.Ecs.GetInstances.Invoke(new() { 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 }) }package generated_program; import com.pulumi.Context; import com.pulumi.Pulumi; import com.pulumi.core.Output; import com.pulumi.alicloud.ecs.EcsFunctions; import com.pulumi.alicloud.ecs.inputs.GetInstancesArgs; import java.util.List; import java.util.ArrayList; import java.util.Map; import java.io.File; import java.nio.file.Files; import java.nio.file.Paths; public class App { public static void main(String[] args) { Pulumi.run(App::stack); } public static void stack(Context ctx) { final var taggedInstances = EcsFunctions.getInstances(GetInstancesArgs.builder() .tags(Map.ofEntries( Map.entry("tagKey1", "tagValue1"), Map.entry("tagKey2", "tagValue2") )) .build()); } }variables: taggedInstances: fn::invoke: function: alicloud:ecs:getInstances arguments: tags: tagKey1: tagValue1 tagKey2: tagValue2 title="Optional"> <span id="vpcid_nodejs">vpc
Id string- ID of the VPC linked to the instances.
- vswitch
Id string - ID of the vSwitch linked to the instances.
- availability_
zone str - Availability zone where instances are located.
- enable_
details bool - Default to
true. If false, the attributesram_role_nameanddisk_device_mappingswill not be fetched and output. - ids Sequence[str]
- A list of ECS instance IDs.
- image_
id str - The image ID of some ECS instance used.
- instance_
name str - The name of the instance. Fuzzy search with the asterisk (*) wildcard characters is supported.
- name_
regex str - A regex string to filter results by instance name.
- output_
file str - File name where to save data source results (after running
pulumi preview). - page_
number int - page_
size int - ram_
role_ strname - The RAM role name which the instance attaches.
- resource_
group_ strid - 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.
- Mapping[str, str]
- 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 = 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 System.Collections.Generic; using System.Linq; using Pulumi; using AliCloud = Pulumi.AliCloud; return await Deployment.RunAsync(() => { var taggedInstances = AliCloud.Ecs.GetInstances.Invoke(new() { 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 }) }package generated_program; import com.pulumi.Context; import com.pulumi.Pulumi; import com.pulumi.core.Output; import com.pulumi.alicloud.ecs.EcsFunctions; import com.pulumi.alicloud.ecs.inputs.GetInstancesArgs; import java.util.List; import java.util.ArrayList; import java.util.Map; import java.io.File; import java.nio.file.Files; import java.nio.file.Paths; public class App { public static void main(String[] args) { Pulumi.run(App::stack); } public static void stack(Context ctx) { final var taggedInstances = EcsFunctions.getInstances(GetInstancesArgs.builder() .tags(Map.ofEntries( Map.entry("tagKey1", "tagValue1"), Map.entry("tagKey2", "tagValue2") )) .build()); } }variables: taggedInstances: fn::invoke: function: alicloud:ecs:getInstances arguments: tags: tagKey1: tagValue1 tagKey2: tagValue2 title="Optional"> <span id="vpc_id_python">vpc_
id str- ID of the VPC linked to the instances.
- vswitch_
id str - ID of the vSwitch linked to the instances.
- availability
Zone String - Availability zone where instances are located.
- enable
Details Boolean - Default to
true. If false, the attributesram_role_nameanddisk_device_mappingswill not be fetched and output. - ids List<String>
- A list of ECS instance IDs.
- image
Id String - The image ID of some ECS instance used.
- instance
Name String - The name of the instance. Fuzzy search with the asterisk (*) wildcard characters is supported.
- name
Regex String - A regex string to filter results by instance name.
- output
File String - File name where to save data source results (after running
pulumi preview). - page
Number Number - page
Size Number - ram
Role StringName - The RAM role name which the instance attaches.
- resource
Group StringId - 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.
- Map<String>
- 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 = 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 System.Collections.Generic; using System.Linq; using Pulumi; using AliCloud = Pulumi.AliCloud; return await Deployment.RunAsync(() => { var taggedInstances = AliCloud.Ecs.GetInstances.Invoke(new() { 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 }) }package generated_program; import com.pulumi.Context; import com.pulumi.Pulumi; import com.pulumi.core.Output; import com.pulumi.alicloud.ecs.EcsFunctions; import com.pulumi.alicloud.ecs.inputs.GetInstancesArgs; import java.util.List; import java.util.ArrayList; import java.util.Map; import java.io.File; import java.nio.file.Files; import java.nio.file.Paths; public class App { public static void main(String[] args) { Pulumi.run(App::stack); } public static void stack(Context ctx) { final var taggedInstances = EcsFunctions.getInstances(GetInstancesArgs.builder() .tags(Map.ofEntries( Map.entry("tagKey1", "tagValue1"), Map.entry("tagKey2", "tagValue2") )) .build()); } }variables: taggedInstances: fn::invoke: function: alicloud:ecs:getInstances arguments: tags: tagKey1: tagValue1 tagKey2: tagValue2 title="Optional"> <span id="vpcid_yaml">vpc
Id String- ID of the VPC linked to the instances.
- vswitch
Id 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>
- Instances
List<Pulumi.
Ali Cloud. Ecs. Outputs. Get Instances Instance> - A list of instances. Each element contains the following attributes:
- Names List<string>
- A list of instances names.
- Total
Count int - Availability
Zone string - Availability zone the instance belongs to.
- Enable
Details bool - Image
Id string - Image ID the instance is using.
- Instance
Name string - Name
Regex string - Output
File string - Page
Number int - Page
Size int - Ram
Role stringName - The Ram role name.
- Resource
Group stringId - The Id of resource group.
- Status string
- Instance current status.
- Dictionary<string, string>
- A map of tags assigned to the ECS instance.
- Vpc
Id string - ID of the VPC the instance belongs to.
- Vswitch
Id string - ID of the vSwitch the instance belongs to.
- Id string
- The provider-assigned unique ID for this managed resource.
- Ids []string
- Instances
[]Get
Instances Instance - A list of instances. Each element contains the following attributes:
- Names []string
- A list of instances names.
- Total
Count int - Availability
Zone string - Availability zone the instance belongs to.
- Enable
Details bool - Image
Id string - Image ID the instance is using.
- Instance
Name string - Name
Regex string - Output
File string - Page
Number int - Page
Size int - Ram
Role stringName - The Ram role name.
- Resource
Group stringId - The Id of resource group.
- Status string
- Instance current status.
- map[string]string
- A map of tags assigned to the ECS instance.
- Vpc
Id string - ID of the VPC the instance belongs to.
- Vswitch
Id string - ID of the vSwitch the instance belongs to.
- id String
- The provider-assigned unique ID for this managed resource.
- ids List<String>
- instances
List<Get
Instances Instance> - A list of instances. Each element contains the following attributes:
- names List<String>
- A list of instances names.
- total
Count Integer - availability
Zone String - Availability zone the instance belongs to.
- enable
Details Boolean - image
Id String - Image ID the instance is using.
- instance
Name String - name
Regex String - output
File String - page
Number Integer - page
Size Integer - ram
Role StringName - The Ram role name.
- resource
Group StringId - The Id of resource group.
- status String
- Instance current status.
- Map<String,String>
- A map of tags assigned to the ECS instance.
- vpc
Id String - ID of the VPC the instance belongs to.
- vswitch
Id String - ID of the vSwitch the instance belongs to.
- id string
- The provider-assigned unique ID for this managed resource.
- ids string[]
- instances
Get
Instances Instance[] - A list of instances. Each element contains the following attributes:
- names string[]
- A list of instances names.
- total
Count number - availability
Zone string - Availability zone the instance belongs to.
- enable
Details boolean - image
Id string - Image ID the instance is using.
- instance
Name string - name
Regex string - output
File string - page
Number number - page
Size number - ram
Role stringName - The Ram role name.
- resource
Group stringId - The Id of resource group.
- status string
- Instance current status.
- {[key: string]: string}
- A map of tags assigned to the ECS instance.
- vpc
Id string - ID of the VPC the instance belongs to.
- vswitch
Id string - ID of the vSwitch the instance belongs to.
- id str
- The provider-assigned unique ID for this managed resource.
- ids Sequence[str]
- instances
Sequence[Get
Instances Instance] - 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.
- enable_
details bool - image_
id str - Image ID the instance is using.
- instance_
name str - name_
regex str - output_
file str - page_
number int - page_
size int - ram_
role_ strname - The Ram role name.
- resource_
group_ strid - The Id of resource group.
- status str
- Instance current status.
- Mapping[str, str]
- 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>
- instances List<Property Map>
- A list of instances. Each element contains the following attributes:
- names List<String>
- A list of instances names.
- total
Count Number - availability
Zone String - Availability zone the instance belongs to.
- enable
Details Boolean - image
Id String - Image ID the instance is using.
- instance
Name String - name
Regex String - output
File String - page
Number Number - page
Size Number - ram
Role StringName - The Ram role name.
- resource
Group StringId - The Id of resource group.
- status String
- Instance current status.
- Map<String>
- A map of tags assigned to the ECS instance.
- vpc
Id String - ID of the VPC the instance belongs to.
- vswitch
Id String - ID of the vSwitch the instance belongs to.
Supporting Types
GetInstancesInstance
- Availability
Zone string - Availability zone where instances are located.
- Creation
Time string - Instance creation time.
- Description string
- Instance description.
- Disk
Device List<Pulumi.Mappings Ali Cloud. Ecs. Inputs. Get Instances Instance Disk Device Mapping> - Description of the attached disks.
- Eip string
- EIP address the VPC instance is using.
- Id string
- ID of the instance.
- Image
Id string - The image ID of some ECS instance used.
- Instance
Charge stringType - Instance charge type.
- Instance
Type string - Instance type.
- Internet
Charge stringType - Instance network charge type.
- Internet
Max intBandwidth Out - Max output bandwidth for internet.
- Key
Name string - Key pair the instance is using.
- Name string
- Instance name.
- Private
Ip string - Instance private IP address.
- Public
Ip string - Instance public IP address.
- Ram
Role stringName - The RAM role name which the instance attaches.
- Region
Id string - Region ID the instance belongs to.
- Resource
Group stringId - The ID of resource group which the instance belongs.
- Security
Groups List<string> - List of security group IDs the instance belongs to.
- Spot
Strategy 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.
- Dictionary<string, string>
- 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 = 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 System.Collections.Generic; using System.Linq; using Pulumi; using AliCloud = Pulumi.AliCloud; return await Deployment.RunAsync(() => { var taggedInstances = AliCloud.Ecs.GetInstances.Invoke(new() { 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 }) }package generated_program; import com.pulumi.Context; import com.pulumi.Pulumi; import com.pulumi.core.Output; import com.pulumi.alicloud.ecs.EcsFunctions; import com.pulumi.alicloud.ecs.inputs.GetInstancesArgs; import java.util.List; import java.util.ArrayList; import java.util.Map; import java.io.File; import java.nio.file.Files; import java.nio.file.Paths; public class App { public static void main(String[] args) { Pulumi.run(App::stack); } public static void stack(Context ctx) { final var taggedInstances = EcsFunctions.getInstances(GetInstancesArgs.builder() .tags(Map.ofEntries( Map.entry("tagKey1", "tagValue1"), Map.entry("tagKey2", "tagValue2") )) .build()); } }variables: taggedInstances: fn::invoke: function: alicloud:ecs:getInstances arguments: tags: tagKey1: tagValue1 tagKey2: tagValue2 title="Required"> <span id="vpcid_csharp">Vpc
Id string- ID of the VPC linked to the instances.
- Vswitch
Id string - ID of the vSwitch linked to the instances.
- Availability
Zone string - Availability zone where instances are located.
- Creation
Time string - Instance creation time.
- Description string
- Instance description.
- Disk
Device []GetMappings Instances Instance Disk Device Mapping - Description of the attached disks.
- Eip string
- EIP address the VPC instance is using.
- Id string
- ID of the instance.
- Image
Id string - The image ID of some ECS instance used.
- Instance
Charge stringType - Instance charge type.
- Instance
Type string - Instance type.
- Internet
Charge stringType - Instance network charge type.
- Internet
Max intBandwidth Out - Max output bandwidth for internet.
- Key
Name string - Key pair the instance is using.
- Name string
- Instance name.
- Private
Ip string - Instance private IP address.
- Public
Ip string - Instance public IP address.
- Ram
Role stringName - The RAM role name which the instance attaches.
- Region
Id string - Region ID the instance belongs to.
- Resource
Group stringId - The ID of resource group which the instance belongs.
- Security
Groups []string - List of security group IDs the instance belongs to.
- Spot
Strategy 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.
- map[string]string
- 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 = 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 System.Collections.Generic; using System.Linq; using Pulumi; using AliCloud = Pulumi.AliCloud; return await Deployment.RunAsync(() => { var taggedInstances = AliCloud.Ecs.GetInstances.Invoke(new() { 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 }) }package generated_program; import com.pulumi.Context; import com.pulumi.Pulumi; import com.pulumi.core.Output; import com.pulumi.alicloud.ecs.EcsFunctions; import com.pulumi.alicloud.ecs.inputs.GetInstancesArgs; import java.util.List; import java.util.ArrayList; import java.util.Map; import java.io.File; import java.nio.file.Files; import java.nio.file.Paths; public class App { public static void main(String[] args) { Pulumi.run(App::stack); } public static void stack(Context ctx) { final var taggedInstances = EcsFunctions.getInstances(GetInstancesArgs.builder() .tags(Map.ofEntries( Map.entry("tagKey1", "tagValue1"), Map.entry("tagKey2", "tagValue2") )) .build()); } }variables: taggedInstances: fn::invoke: function: alicloud:ecs:getInstances arguments: tags: tagKey1: tagValue1 tagKey2: tagValue2 title="Required"> <span id="vpcid_go">Vpc
Id string- ID of the VPC linked to the instances.
- Vswitch
Id string - ID of the vSwitch linked to the instances.
- availability
Zone String - Availability zone where instances are located.
- creation
Time String - Instance creation time.
- description String
- Instance description.
- disk
Device List<GetMappings Instances Instance Disk Device Mapping> - Description of the attached disks.
- eip String
- EIP address the VPC instance is using.
- id String
- ID of the instance.
- image
Id String - The image ID of some ECS instance used.
- instance
Charge StringType - Instance charge type.
- instance
Type String - Instance type.
- internet
Charge StringType - Instance network charge type.
- internet
Max IntegerBandwidth Out - Max output bandwidth for internet.
- key
Name String - Key pair the instance is using.
- name String
- Instance name.
- private
Ip String - Instance private IP address.
- public
Ip String - Instance public IP address.
- ram
Role StringName - The RAM role name which the instance attaches.
- region
Id String - Region ID the instance belongs to.
- resource
Group StringId - The ID of resource group which the instance belongs.
- security
Groups List<String> - List of security group IDs the instance belongs to.
- spot
Strategy 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.
- Map<String,String>
- 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 = 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 System.Collections.Generic; using System.Linq; using Pulumi; using AliCloud = Pulumi.AliCloud; return await Deployment.RunAsync(() => { var taggedInstances = AliCloud.Ecs.GetInstances.Invoke(new() { 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 }) }package generated_program; import com.pulumi.Context; import com.pulumi.Pulumi; import com.pulumi.core.Output; import com.pulumi.alicloud.ecs.EcsFunctions; import com.pulumi.alicloud.ecs.inputs.GetInstancesArgs; import java.util.List; import java.util.ArrayList; import java.util.Map; import java.io.File; import java.nio.file.Files; import java.nio.file.Paths; public class App { public static void main(String[] args) { Pulumi.run(App::stack); } public static void stack(Context ctx) { final var taggedInstances = EcsFunctions.getInstances(GetInstancesArgs.builder() .tags(Map.ofEntries( Map.entry("tagKey1", "tagValue1"), Map.entry("tagKey2", "tagValue2") )) .build()); } }variables: taggedInstances: fn::invoke: function: alicloud:ecs:getInstances arguments: tags: tagKey1: tagValue1 tagKey2: tagValue2 title="Required"> <span id="vpcid_java">vpc
Id String- ID of the VPC linked to the instances.
- vswitch
Id String - ID of the vSwitch linked to the instances.
- availability
Zone string - Availability zone where instances are located.
- creation
Time string - Instance creation time.
- description string
- Instance description.
- disk
Device GetMappings Instances Instance Disk Device Mapping[] - Description of the attached disks.
- eip string
- EIP address the VPC instance is using.
- id string
- ID of the instance.
- image
Id string - The image ID of some ECS instance used.
- instance
Charge stringType - Instance charge type.
- instance
Type string - Instance type.
- internet
Charge stringType - Instance network charge type.
- internet
Max numberBandwidth Out - Max output bandwidth for internet.
- key
Name string - Key pair the instance is using.
- name string
- Instance name.
- private
Ip string - Instance private IP address.
- public
Ip string - Instance public IP address.
- ram
Role stringName - The RAM role name which the instance attaches.
- region
Id string - Region ID the instance belongs to.
- resource
Group stringId - The ID of resource group which the instance belongs.
- security
Groups string[] - List of security group IDs the instance belongs to.
- spot
Strategy 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.
- {[key: string]: string}
- 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 = 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 System.Collections.Generic; using System.Linq; using Pulumi; using AliCloud = Pulumi.AliCloud; return await Deployment.RunAsync(() => { var taggedInstances = AliCloud.Ecs.GetInstances.Invoke(new() { 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 }) }package generated_program; import com.pulumi.Context; import com.pulumi.Pulumi; import com.pulumi.core.Output; import com.pulumi.alicloud.ecs.EcsFunctions; import com.pulumi.alicloud.ecs.inputs.GetInstancesArgs; import java.util.List; import java.util.ArrayList; import java.util.Map; import java.io.File; import java.nio.file.Files; import java.nio.file.Paths; public class App { public static void main(String[] args) { Pulumi.run(App::stack); } public static void stack(Context ctx) { final var taggedInstances = EcsFunctions.getInstances(GetInstancesArgs.builder() .tags(Map.ofEntries( Map.entry("tagKey1", "tagValue1"), Map.entry("tagKey2", "tagValue2") )) .build()); } }variables: taggedInstances: fn::invoke: function: alicloud:ecs:getInstances arguments: tags: tagKey1: tagValue1 tagKey2: tagValue2 title="Required"> <span id="vpcid_nodejs">vpc
Id string- ID of the VPC linked to the instances.
- vswitch
Id string - ID of the vSwitch linked to the instances.
- availability_
zone str - Availability zone where instances are located.
- creation_
time str - Instance creation time.
- description str
- Instance description.
- disk_
device_ Sequence[Getmappings Instances Instance Disk Device Mapping] - 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_ strtype - Instance charge type.
- instance_
type str - Instance type.
- internet_
charge_ strtype - Instance network charge type.
- internet_
max_ intbandwidth_ out - 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_ strname - The RAM role name which the instance attaches.
- region_
id str - Region ID the instance belongs to.
- resource_
group_ strid - 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.
- Mapping[str, str]
- 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 = 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 System.Collections.Generic; using System.Linq; using Pulumi; using AliCloud = Pulumi.AliCloud; return await Deployment.RunAsync(() => { var taggedInstances = AliCloud.Ecs.GetInstances.Invoke(new() { 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 }) }package generated_program; import com.pulumi.Context; import com.pulumi.Pulumi; import com.pulumi.core.Output; import com.pulumi.alicloud.ecs.EcsFunctions; import com.pulumi.alicloud.ecs.inputs.GetInstancesArgs; import java.util.List; import java.util.ArrayList; import java.util.Map; import java.io.File; import java.nio.file.Files; import java.nio.file.Paths; public class App { public static void main(String[] args) { Pulumi.run(App::stack); } public static void stack(Context ctx) { final var taggedInstances = EcsFunctions.getInstances(GetInstancesArgs.builder() .tags(Map.ofEntries( Map.entry("tagKey1", "tagValue1"), Map.entry("tagKey2", "tagValue2") )) .build()); } }variables: taggedInstances: fn::invoke: function: alicloud:ecs:getInstances arguments: tags: tagKey1: tagValue1 tagKey2: tagValue2 title="Required"> <span id="vpc_id_python">vpc_
id str- ID of the VPC linked to the instances.
- vswitch_
id str - ID of the vSwitch linked to the instances.
- availability
Zone String - Availability zone where instances are located.
- creation
Time String - Instance creation time.
- description String
- Instance description.
- disk
Device List<Property Map>Mappings - Description of the attached disks.
- eip String
- EIP address the VPC instance is using.
- id String
- ID of the instance.
- image
Id String - The image ID of some ECS instance used.
- instance
Charge StringType - Instance charge type.
- instance
Type String - Instance type.
- internet
Charge StringType - Instance network charge type.
- internet
Max NumberBandwidth Out - Max output bandwidth for internet.
- key
Name String - Key pair the instance is using.
- name String
- Instance name.
- private
Ip String - Instance private IP address.
- public
Ip String - Instance public IP address.
- ram
Role StringName - The RAM role name which the instance attaches.
- region
Id String - Region ID the instance belongs to.
- resource
Group StringId - The ID of resource group which the instance belongs.
- security
Groups List<String> - List of security group IDs the instance belongs to.
- spot
Strategy 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.
- Map<String>
- 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 = 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 System.Collections.Generic; using System.Linq; using Pulumi; using AliCloud = Pulumi.AliCloud; return await Deployment.RunAsync(() => { var taggedInstances = AliCloud.Ecs.GetInstances.Invoke(new() { 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 }) }package generated_program; import com.pulumi.Context; import com.pulumi.Pulumi; import com.pulumi.core.Output; import com.pulumi.alicloud.ecs.EcsFunctions; import com.pulumi.alicloud.ecs.inputs.GetInstancesArgs; import java.util.List; import java.util.ArrayList; import java.util.Map; import java.io.File; import java.nio.file.Files; import java.nio.file.Paths; public class App { public static void main(String[] args) { Pulumi.run(App::stack); } public static void stack(Context ctx) { final var taggedInstances = EcsFunctions.getInstances(GetInstancesArgs.builder() .tags(Map.ofEntries( Map.entry("tagKey1", "tagValue1"), Map.entry("tagKey2", "tagValue2") )) .build()); } }variables: taggedInstances: fn::invoke: function: alicloud:ecs:getInstances arguments: tags: tagKey1: tagValue1 tagKey2: tagValue2 title="Required"> <span id="vpcid_yaml">vpc
Id String- ID of the VPC linked to the instances.
- vswitch
Id String - ID of the vSwitch linked to the instances.
GetInstancesInstanceDiskDeviceMapping
Package Details
- Repository
- Alibaba Cloud pulumi/pulumi-alicloud
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
alicloudTerraform Provider.
published on Saturday, Mar 14, 2026 by Pulumi
