-
Notifications
You must be signed in to change notification settings - Fork 151
/
getInstances.go
52 lines (47 loc) · 2.35 KB
/
getInstances.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
// *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***
package ec2
import (
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
// Use this data source to get IDs or IPs of Amazon EC2 instances to be referenced elsewhere,
// e.g. to allow easier migration from another management solution
// or to make it easier for an operator to connect through bastion host(s).
//
// > **Note:** It's strongly discouraged to use this data source for querying ephemeral
// instances (e.g. managed via autoscaling group), as the output may change at any time
// and you'd need to re-run `apply` every time an instance comes up or dies.
func GetInstances(ctx *pulumi.Context, args *GetInstancesArgs, opts ...pulumi.InvokeOption) (*GetInstancesResult, error) {
var rv GetInstancesResult
err := ctx.Invoke("aws:ec2/getInstances:getInstances", args, &rv, opts...)
if err != nil {
return nil, err
}
return &rv, nil
}
// A collection of arguments for invoking getInstances.
type GetInstancesArgs struct {
// One or more name/value pairs to use as filters. There are
// several valid keys, for a full reference, check out
// [describe-instances in the AWS CLI reference][1].
Filters []GetInstancesFilter `pulumi:"filters"`
// A list of instance states that should be applicable to the desired instances. The permitted values are: `pending, running, shutting-down, stopped, stopping, terminated`. The default value is `running`.
InstanceStateNames []string `pulumi:"instanceStateNames"`
// A map of tags, each pair of which must
// exactly match a pair on desired instances.
InstanceTags map[string]string `pulumi:"instanceTags"`
}
// A collection of values returned by getInstances.
type GetInstancesResult struct {
Filters []GetInstancesFilter `pulumi:"filters"`
// The provider-assigned unique ID for this managed resource.
Id string `pulumi:"id"`
// IDs of instances found through the filter
Ids []string `pulumi:"ids"`
InstanceStateNames []string `pulumi:"instanceStateNames"`
InstanceTags map[string]string `pulumi:"instanceTags"`
// Private IP addresses of instances found through the filter
PrivateIps []string `pulumi:"privateIps"`
// Public IP addresses of instances found through the filter
PublicIps []string `pulumi:"publicIps"`
}