Alibaba Cloud
getInstances
This data source provides the Eais Instances of the current Alibaba Cloud user.
NOTE: Available in v1.137.0+.
Example Usage
using Pulumi;
using AliCloud = Pulumi.AliCloud;
class MyStack : Stack
{
public MyStack()
{
var ids = Output.Create(AliCloud.Eais.GetInstances.InvokeAsync(new AliCloud.Eais.GetInstancesArgs
{
Id =
{
"example_id",
},
}));
this.EaisInstanceId1 = ids.Apply(ids => ids.Instances?[0]?.Id);
var nameRegex = Output.Create(AliCloud.Eais.GetInstances.InvokeAsync(new AliCloud.Eais.GetInstancesArgs
{
NameRegex = "^my-Instance",
}));
this.EaisInstanceId2 = nameRegex.Apply(nameRegex => nameRegex.Instances?[0]?.Id);
}
[Output("eaisInstanceId1")]
public Output<string> EaisInstanceId1 { get; set; }
[Output("eaisInstanceId2")]
public Output<string> EaisInstanceId2 { get; set; }
}
package main
import (
"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/eais"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
ids, err := eais.GetInstances(ctx, &eais.GetInstancesArgs{
Id: []string{
"example_id",
},
}, nil)
if err != nil {
return err
}
ctx.Export("eaisInstanceId1", ids.Instances[0].Id)
nameRegex, err := eais.GetInstances(ctx, &eais.GetInstancesArgs{
NameRegex: pulumi.StringRef("^my-Instance"),
}, nil)
if err != nil {
return err
}
ctx.Export("eaisInstanceId2", nameRegex.Instances[0].Id)
return nil
})
}
Coming soon!
import pulumi
import pulumi_alicloud as alicloud
ids = alicloud.eais.get_instances(id=["example_id"])
pulumi.export("eaisInstanceId1", ids.instances[0].id)
name_regex = alicloud.eais.get_instances(name_regex="^my-Instance")
pulumi.export("eaisInstanceId2", name_regex.instances[0].id)
import * as pulumi from "@pulumi/pulumi";
import * as alicloud from "@pulumi/alicloud";
const ids = alicloud.eais.getInstances({
id: ["example_id"],
});
export const eaisInstanceId1 = ids.then(ids => ids.instances?[0]?.id);
const nameRegex = alicloud.eais.getInstances({
nameRegex: "^my-Instance",
});
export const eaisInstanceId2 = nameRegex.then(nameRegex => nameRegex.instances?[0]?.id);
Coming soon!
Using getInstances
Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.
function getInstances(args: GetInstancesArgs, opts?: InvokeOptions): Promise<GetInstancesResult>
function getInstancesOutput(args: GetInstancesOutputArgs, opts?: InvokeOptions): Output<GetInstancesResult>
def get_instances(ids: Optional[Sequence[str]] = None,
instance_type: Optional[str] = None,
name_regex: Optional[str] = None,
output_file: Optional[str] = None,
status: Optional[str] = None,
opts: Optional[InvokeOptions] = None) -> GetInstancesResult
def get_instances_output(ids: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
instance_type: Optional[pulumi.Input[str]] = None,
name_regex: Optional[pulumi.Input[str]] = None,
output_file: Optional[pulumi.Input[str]] = None,
status: Optional[pulumi.Input[str]] = None,
opts: Optional[InvokeOptions] = None) -> Output[GetInstancesResult]
func GetInstances(ctx *Context, args *GetInstancesArgs, opts ...InvokeOption) (*GetInstancesResult, error)
func GetInstancesOutput(ctx *Context, args *GetInstancesOutputArgs, opts ...InvokeOption) GetInstancesResultOutput
> Note: This function is named GetInstances
in the Go SDK.
public static class GetInstances
{
public static Task<GetInstancesResult> InvokeAsync(GetInstancesArgs args, InvokeOptions? opts = null)
public static Output<GetInstancesResult> Invoke(GetInstancesInvokeArgs args, InvokeOptions? opts = null)
}
public static CompletableFuture<GetInstancesResult> getInstances(GetInstancesArgs args, InvokeOptions options)
// Output-based functions aren't available in Java yet
Fn::Invoke:
Function: alicloud:eais/getInstances:getInstances
Arguments:
# Arguments dictionary
The following arguments are supported:
- Ids List<string>
A list of Instance IDs.
- Instance
Type string The type of the resource. Valid values:
eais.ei-a6.4xlarge
,eais.ei-a6.2xlarge
,eais.ei-a6.xlarge
,eais.ei-a6.large
,eais.ei-a6.medium
.- Name
Regex string A regex string to filter results by Instance name.
- Output
File string - Status string
The status of the resource. Valid values:
Attaching
,Available
,Detaching
,InUse
,Starting
,Unavailable
.
- Ids []string
A list of Instance IDs.
- Instance
Type string The type of the resource. Valid values:
eais.ei-a6.4xlarge
,eais.ei-a6.2xlarge
,eais.ei-a6.xlarge
,eais.ei-a6.large
,eais.ei-a6.medium
.- Name
Regex string A regex string to filter results by Instance name.
- Output
File string - Status string
The status of the resource. Valid values:
Attaching
,Available
,Detaching
,InUse
,Starting
,Unavailable
.
- ids
List
A list of Instance IDs.
- instance
Type String The type of the resource. Valid values:
eais.ei-a6.4xlarge
,eais.ei-a6.2xlarge
,eais.ei-a6.xlarge
,eais.ei-a6.large
,eais.ei-a6.medium
.- name
Regex String A regex string to filter results by Instance name.
- output
File String - status String
The status of the resource. Valid values:
Attaching
,Available
,Detaching
,InUse
,Starting
,Unavailable
.
- ids string[]
A list of Instance IDs.
- instance
Type string The type of the resource. Valid values:
eais.ei-a6.4xlarge
,eais.ei-a6.2xlarge
,eais.ei-a6.xlarge
,eais.ei-a6.large
,eais.ei-a6.medium
.- name
Regex string A regex string to filter results by Instance name.
- output
File string - status string
The status of the resource. Valid values:
Attaching
,Available
,Detaching
,InUse
,Starting
,Unavailable
.
- ids Sequence[str]
A list of Instance IDs.
- instance_
type str The type of the resource. Valid values:
eais.ei-a6.4xlarge
,eais.ei-a6.2xlarge
,eais.ei-a6.xlarge
,eais.ei-a6.large
,eais.ei-a6.medium
.- name_
regex str A regex string to filter results by Instance name.
- output_
file str - status str
The status of the resource. Valid values:
Attaching
,Available
,Detaching
,InUse
,Starting
,Unavailable
.
- ids
List
A list of Instance IDs.
- instance
Type String The type of the resource. Valid values:
eais.ei-a6.4xlarge
,eais.ei-a6.2xlarge
,eais.ei-a6.xlarge
,eais.ei-a6.large
,eais.ei-a6.medium
.- name
Regex String A regex string to filter results by Instance name.
- output
File String - status String
The status of the resource. Valid values:
Attaching
,Available
,Detaching
,InUse
,Starting
,Unavailable
.
getInstances Result
The following output properties are available:
- Id string
The provider-assigned unique ID for this managed resource.
- Ids List<string>
- Instances
List<Pulumi.
Ali Cloud. Eais. Outputs. Get Instances Instance> - Names List<string>
- Instance
Type string - Name
Regex string - Output
File string - Status string
- Id string
The provider-assigned unique ID for this managed resource.
- Ids []string
- Instances
[]Get
Instances Instance - Names []string
- Instance
Type string - Name
Regex string - Output
File string - Status string
- id String
The provider-assigned unique ID for this managed resource.
- ids
List
- instances
List
Instances Instance> - names
List
- instance
Type String - name
Regex String - output
File String - status String
- id string
The provider-assigned unique ID for this managed resource.
- ids string[]
- instances
Get
Instances Instance[] - names string[]
- instance
Type string - name
Regex string - output
File string - status string
- id str
The provider-assigned unique ID for this managed resource.
- ids Sequence[str]
- instances
Sequence[Get
Instances Instance] - names Sequence[str]
- instance_
type str - name_
regex str - output_
file str - status str
- id String
The provider-assigned unique ID for this managed resource.
- ids
List
- instances
List
- names
List
- instance
Type String - name
Regex String - output
File String - status String
Supporting Types
GetInstancesInstance
- Client
Instance stringId The ID of the ECS instance to be bound.
- Client
Instance stringName The name of the ECS instance bound to the EAIS instance.
- Client
Instance stringType The type of the ECS instance bound to the EAIS instance.
- Id string
The ID of the Instance.
- Instance
Id string The ID of the resource.
- Instance
Name string The name of the resource.
- Instance
Type string The type of the resource. Valid values:
eais.ei-a6.4xlarge
,eais.ei-a6.2xlarge
,eais.ei-a6.xlarge
,eais.ei-a6.large
,eais.ei-a6.medium
.- Status string
The status of the resource. Valid values:
Attaching
,Available
,Detaching
,InUse
,Starting
,Unavailable
.- Zone
Id string The ID of the region to which the EAIS instance belongs.
- Client
Instance stringId The ID of the ECS instance to be bound.
- Client
Instance stringName The name of the ECS instance bound to the EAIS instance.
- Client
Instance stringType The type of the ECS instance bound to the EAIS instance.
- Id string
The ID of the Instance.
- Instance
Id string The ID of the resource.
- Instance
Name string The name of the resource.
- Instance
Type string The type of the resource. Valid values:
eais.ei-a6.4xlarge
,eais.ei-a6.2xlarge
,eais.ei-a6.xlarge
,eais.ei-a6.large
,eais.ei-a6.medium
.- Status string
The status of the resource. Valid values:
Attaching
,Available
,Detaching
,InUse
,Starting
,Unavailable
.- Zone
Id string The ID of the region to which the EAIS instance belongs.
- client
Instance StringId The ID of the ECS instance to be bound.
- client
Instance StringName The name of the ECS instance bound to the EAIS instance.
- client
Instance StringType The type of the ECS instance bound to the EAIS instance.
- id String
The ID of the Instance.
- instance
Id String The ID of the resource.
- instance
Name String The name of the resource.
- instance
Type String The type of the resource. Valid values:
eais.ei-a6.4xlarge
,eais.ei-a6.2xlarge
,eais.ei-a6.xlarge
,eais.ei-a6.large
,eais.ei-a6.medium
.- status String
The status of the resource. Valid values:
Attaching
,Available
,Detaching
,InUse
,Starting
,Unavailable
.- zone
Id String The ID of the region to which the EAIS instance belongs.
- client
Instance stringId The ID of the ECS instance to be bound.
- client
Instance stringName The name of the ECS instance bound to the EAIS instance.
- client
Instance stringType The type of the ECS instance bound to the EAIS instance.
- id string
The ID of the Instance.
- instance
Id string The ID of the resource.
- instance
Name string The name of the resource.
- instance
Type string The type of the resource. Valid values:
eais.ei-a6.4xlarge
,eais.ei-a6.2xlarge
,eais.ei-a6.xlarge
,eais.ei-a6.large
,eais.ei-a6.medium
.- status string
The status of the resource. Valid values:
Attaching
,Available
,Detaching
,InUse
,Starting
,Unavailable
.- zone
Id string The ID of the region to which the EAIS instance belongs.
- client_
instance_ strid The ID of the ECS instance to be bound.
- client_
instance_ strname The name of the ECS instance bound to the EAIS instance.
- client_
instance_ strtype The type of the ECS instance bound to the EAIS instance.
- id str
The ID of the Instance.
- instance_
id str The ID of the resource.
- instance_
name str The name of the resource.
- instance_
type str The type of the resource. Valid values:
eais.ei-a6.4xlarge
,eais.ei-a6.2xlarge
,eais.ei-a6.xlarge
,eais.ei-a6.large
,eais.ei-a6.medium
.- status str
The status of the resource. Valid values:
Attaching
,Available
,Detaching
,InUse
,Starting
,Unavailable
.- zone_
id str The ID of the region to which the EAIS instance belongs.
- client
Instance StringId The ID of the ECS instance to be bound.
- client
Instance StringName The name of the ECS instance bound to the EAIS instance.
- client
Instance StringType The type of the ECS instance bound to the EAIS instance.
- id String
The ID of the Instance.
- instance
Id String The ID of the resource.
- instance
Name String The name of the resource.
- instance
Type String The type of the resource. Valid values:
eais.ei-a6.4xlarge
,eais.ei-a6.2xlarge
,eais.ei-a6.xlarge
,eais.ei-a6.large
,eais.ei-a6.medium
.- status String
The status of the resource. Valid values:
Attaching
,Available
,Detaching
,InUse
,Starting
,Unavailable
.- zone
Id String The ID of the region to which the EAIS instance belongs.
Package Details
- Repository
- https://github.com/pulumi/pulumi-alicloud
- License
- Apache-2.0
- Notes
This Pulumi package is based on the
alicloud
Terraform Provider.