/
getElasticIp.go
164 lines (159 loc) · 5.02 KB
/
getElasticIp.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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
// *** 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 aws
import (
"github.com/pulumi/pulumi/sdk/v2/go/pulumi"
)
// `ec2.Eip` provides details about a specific Elastic IP.
//
// ## Example Usage
// ### Search By Allocation ID (VPC only)
//
// ```go
// package main
//
// import (
// "github.com/pulumi/pulumi-aws/sdk/v2/go/aws"
// "github.com/pulumi/pulumi/sdk/v2/go/pulumi"
// )
//
// func main() {
// pulumi.Run(func(ctx *pulumi.Context) error {
// opt0 := "eipalloc-12345678"
// _, err := aws.GetElasticIp(ctx, &aws.GetElasticIpArgs{
// Id: &opt0,
// }, nil)
// if err != nil {
// return err
// }
// return nil
// })
// }
// ```
// ### Search By Filters (EC2-Classic or VPC)
//
// ```go
// package main
//
// import (
// "github.com/pulumi/pulumi-aws/sdk/v2/go/aws"
// "github.com/pulumi/pulumi/sdk/v2/go/pulumi"
// )
//
// func main() {
// pulumi.Run(func(ctx *pulumi.Context) error {
// _, err := aws.GetElasticIp(ctx, &aws.GetElasticIpArgs{
// Filters: []aws.GetElasticIpFilter{
// aws.GetElasticIpFilter{
// Name: "tag:Name",
// Values: []string{
// "exampleNameTagValue",
// },
// },
// },
// }, nil)
// if err != nil {
// return err
// }
// return nil
// })
// }
// ```
// ### Search By Public IP (EC2-Classic or VPC)
//
// ```go
// package main
//
// import (
// "github.com/pulumi/pulumi-aws/sdk/v2/go/aws"
// "github.com/pulumi/pulumi/sdk/v2/go/pulumi"
// )
//
// func main() {
// pulumi.Run(func(ctx *pulumi.Context) error {
// opt0 := "1.2.3.4"
// _, err := aws.GetElasticIp(ctx, &aws.GetElasticIpArgs{
// PublicIp: &opt0,
// }, nil)
// if err != nil {
// return err
// }
// return nil
// })
// }
// ```
// ### Search By Tags (EC2-Classic or VPC)
//
// ```go
// package main
//
// import (
// "github.com/pulumi/pulumi-aws/sdk/v2/go/aws"
// "github.com/pulumi/pulumi/sdk/v2/go/pulumi"
// )
//
// func main() {
// pulumi.Run(func(ctx *pulumi.Context) error {
// _, err := aws.GetElasticIp(ctx, &aws.GetElasticIpArgs{
// Tags: map[string]interface{}{
// "Name": "exampleNameTagValue",
// },
// }, nil)
// if err != nil {
// return err
// }
// return nil
// })
// }
// ```
func GetElasticIp(ctx *pulumi.Context, args *GetElasticIpArgs, opts ...pulumi.InvokeOption) (*GetElasticIpResult, error) {
var rv GetElasticIpResult
err := ctx.Invoke("aws:index/getElasticIp:getElasticIp", args, &rv, opts...)
if err != nil {
return nil, err
}
return &rv, nil
}
// A collection of arguments for invoking getElasticIp.
type GetElasticIpArgs struct {
// One or more name/value pairs to use as filters. There are several valid keys, for a full reference, check out the [EC2 API Reference](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_DescribeAddresses.html).
Filters []GetElasticIpFilter `pulumi:"filters"`
// The allocation id of the specific VPC EIP to retrieve. If a classic EIP is required, do NOT set `id`, only set `publicIp`
Id *string `pulumi:"id"`
// The public IP of the specific EIP to retrieve.
PublicIp *string `pulumi:"publicIp"`
// A map of tags, each pair of which must exactly match a pair on the desired Elastic IP
Tags map[string]string `pulumi:"tags"`
}
// A collection of values returned by getElasticIp.
type GetElasticIpResult struct {
// The ID representing the association of the address with an instance in a VPC.
AssociationId string `pulumi:"associationId"`
// Customer Owned IP.
CustomerOwnedIp string `pulumi:"customerOwnedIp"`
// The ID of a Customer Owned IP Pool. For more on customer owned IP addressed check out [Customer-owned IP addresses guide](https://docs.aws.amazon.com/outposts/latest/userguide/outposts-networking-components.html#ip-addressing)
CustomerOwnedIpv4Pool string `pulumi:"customerOwnedIpv4Pool"`
// Indicates whether the address is for use in EC2-Classic (standard) or in a VPC (vpc).
Domain string `pulumi:"domain"`
Filters []GetElasticIpFilter `pulumi:"filters"`
// If VPC Elastic IP, the allocation identifier. If EC2-Classic Elastic IP, the public IP address.
Id string `pulumi:"id"`
// The ID of the instance that the address is associated with (if any).
InstanceId string `pulumi:"instanceId"`
// The ID of the network interface.
NetworkInterfaceId string `pulumi:"networkInterfaceId"`
// The ID of the AWS account that owns the network interface.
NetworkInterfaceOwnerId string `pulumi:"networkInterfaceOwnerId"`
// The Private DNS associated with the Elastic IP address.
PrivateDns string `pulumi:"privateDns"`
// The private IP address associated with the Elastic IP address.
PrivateIp string `pulumi:"privateIp"`
// Public DNS associated with the Elastic IP address.
PublicDns string `pulumi:"publicDns"`
// Public IP address of Elastic IP.
PublicIp string `pulumi:"publicIp"`
// The ID of an address pool.
PublicIpv4Pool string `pulumi:"publicIpv4Pool"`
// Key-value map of tags associated with Elastic IP.
Tags map[string]string `pulumi:"tags"`
}