Alibaba Cloud
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:
- Availability
Zone string Availability zone where instances are located.
- Ids List<string>
A list of ECS instance IDs.
- Image
Id string The image ID of some ECS instance used.
- Name
Regex string A regex string to filter results by instance name.
- Output
File string - 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, 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 }) }
- 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.
- Ids []string
A list of ECS instance IDs.
- Image
Id string The image ID of some ECS instance used.
- Name
Regex string A regex string to filter results by instance name.
- Output
File string - 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]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 }) }
- 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.
- ids List<String>
A list of ECS instance IDs.
- image
Id String The image ID of some ECS instance used.
- name
Regex String A regex string to filter results by instance name.
- output
File String - 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,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 }) }
- 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.
- ids string[]
A list of ECS instance IDs.
- image
Id string The image ID of some ECS instance used.
- name
Regex string A regex string to filter results by instance name.
- output
File string - 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]: 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 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.
- 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_ 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, 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.
- availability
Zone String Availability zone where instances are located.
- ids List<String>
A list of ECS instance IDs.
- image
Id String The image ID of some ECS instance used.
- name
Regex String A regex string to filter results by instance name.
- output
File String - 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<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 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>
A list of ECS instance IDs.
- 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.
- Image
Id string Image ID the instance is using.
- 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, object>
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
A list of ECS instance IDs.
- 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.
- Image
Id string Image ID the instance is using.
- 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]interface{}
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>
A list of ECS instance IDs.
- 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.
- image
Id String Image ID the instance is using.
- 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,Object>
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[]
A list of ECS instance IDs.
- 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.
- image
Id string Image ID the instance is using.
- 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]: any}
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]
A list of ECS instance IDs.
- 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.
- image_
id str Image ID the instance is using.
- 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, 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.
- total
Count Number - availability
Zone String Availability zone the instance belongs to.
- image
Id String Image ID the instance is using.
- 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<Any>
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.
- Vpc
Id string ID of the VPC linked to the instances.
- Vswitch
Id string ID of the VSwitch linked to the instances.
- 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 }) }
- 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.
- Vpc
Id string ID of the VPC linked to the instances.
- Vswitch
Id string ID of the VSwitch linked to the instances.
- 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 }) }
- 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.
- vpc
Id String ID of the VPC linked to the instances.
- vswitch
Id String ID of the VSwitch linked to the instances.
- 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 }) }
- 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.
- vpc
Id string ID of the VPC linked to the instances.
- vswitch
Id string ID of the VSwitch linked to the instances.
- {[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_ 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.
- vpc_
id str ID of the VPC linked to the instances.
- vswitch_
id str ID of the VSwitch linked to the instances.
- 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 }) }
- 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.
- vpc
Id String ID of the VPC linked to the instances.
- vswitch
Id String ID of the VSwitch linked to the instances.
- 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
Package Details
- Repository
- https://github.com/pulumi/pulumi-alicloud
- License
- Apache-2.0
- Notes
This Pulumi package is based on the
alicloud
Terraform Provider.