-
Notifications
You must be signed in to change notification settings - Fork 151
/
egressOnlyInternetGateway.go
321 lines (261 loc) · 11.9 KB
/
egressOnlyInternetGateway.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
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
// *** 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 (
"context"
"reflect"
"github.com/pkg/errors"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
// [IPv6 only] Creates an egress-only Internet gateway for your VPC.
// An egress-only Internet gateway is used to enable outbound communication
// over IPv6 from instances in your VPC to the Internet, and prevents hosts
// outside of your VPC from initiating an IPv6 connection with your instance.
//
// ## Example Usage
//
// ```go
// package main
//
// import (
// "github.com/pulumi/pulumi-aws/sdk/v4/go/aws/ec2"
// "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
// )
//
// func main() {
// pulumi.Run(func(ctx *pulumi.Context) error {
// exampleVpc, err := ec2.NewVpc(ctx, "exampleVpc", &ec2.VpcArgs{
// CidrBlock: pulumi.String("10.1.0.0/16"),
// AssignGeneratedIpv6CidrBlock: pulumi.Bool(true),
// })
// if err != nil {
// return err
// }
// _, err = ec2.NewEgressOnlyInternetGateway(ctx, "exampleEgressOnlyInternetGateway", &ec2.EgressOnlyInternetGatewayArgs{
// VpcId: exampleVpc.ID(),
// Tags: pulumi.StringMap{
// "Name": pulumi.String("main"),
// },
// })
// if err != nil {
// return err
// }
// return nil
// })
// }
// ```
//
// ## Import
//
// Egress-only Internet gateways can be imported using the `id`, e.g.
//
// ```sh
// $ pulumi import aws:ec2/egressOnlyInternetGateway:EgressOnlyInternetGateway example eigw-015e0e244e24dfe8a
// ```
type EgressOnlyInternetGateway struct {
pulumi.CustomResourceState
Tags pulumi.StringMapOutput `pulumi:"tags"`
TagsAll pulumi.StringMapOutput `pulumi:"tagsAll"`
// The VPC ID to create in.
VpcId pulumi.StringOutput `pulumi:"vpcId"`
}
// NewEgressOnlyInternetGateway registers a new resource with the given unique name, arguments, and options.
func NewEgressOnlyInternetGateway(ctx *pulumi.Context,
name string, args *EgressOnlyInternetGatewayArgs, opts ...pulumi.ResourceOption) (*EgressOnlyInternetGateway, error) {
if args == nil {
return nil, errors.New("missing one or more required arguments")
}
if args.VpcId == nil {
return nil, errors.New("invalid value for required argument 'VpcId'")
}
var resource EgressOnlyInternetGateway
err := ctx.RegisterResource("aws:ec2/egressOnlyInternetGateway:EgressOnlyInternetGateway", name, args, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// GetEgressOnlyInternetGateway gets an existing EgressOnlyInternetGateway resource's state with the given name, ID, and optional
// state properties that are used to uniquely qualify the lookup (nil if not required).
func GetEgressOnlyInternetGateway(ctx *pulumi.Context,
name string, id pulumi.IDInput, state *EgressOnlyInternetGatewayState, opts ...pulumi.ResourceOption) (*EgressOnlyInternetGateway, error) {
var resource EgressOnlyInternetGateway
err := ctx.ReadResource("aws:ec2/egressOnlyInternetGateway:EgressOnlyInternetGateway", name, id, state, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// Input properties used for looking up and filtering EgressOnlyInternetGateway resources.
type egressOnlyInternetGatewayState struct {
Tags map[string]string `pulumi:"tags"`
TagsAll map[string]string `pulumi:"tagsAll"`
// The VPC ID to create in.
VpcId *string `pulumi:"vpcId"`
}
type EgressOnlyInternetGatewayState struct {
Tags pulumi.StringMapInput
TagsAll pulumi.StringMapInput
// The VPC ID to create in.
VpcId pulumi.StringPtrInput
}
func (EgressOnlyInternetGatewayState) ElementType() reflect.Type {
return reflect.TypeOf((*egressOnlyInternetGatewayState)(nil)).Elem()
}
type egressOnlyInternetGatewayArgs struct {
Tags map[string]string `pulumi:"tags"`
TagsAll map[string]string `pulumi:"tagsAll"`
// The VPC ID to create in.
VpcId string `pulumi:"vpcId"`
}
// The set of arguments for constructing a EgressOnlyInternetGateway resource.
type EgressOnlyInternetGatewayArgs struct {
Tags pulumi.StringMapInput
TagsAll pulumi.StringMapInput
// The VPC ID to create in.
VpcId pulumi.StringInput
}
func (EgressOnlyInternetGatewayArgs) ElementType() reflect.Type {
return reflect.TypeOf((*egressOnlyInternetGatewayArgs)(nil)).Elem()
}
type EgressOnlyInternetGatewayInput interface {
pulumi.Input
ToEgressOnlyInternetGatewayOutput() EgressOnlyInternetGatewayOutput
ToEgressOnlyInternetGatewayOutputWithContext(ctx context.Context) EgressOnlyInternetGatewayOutput
}
func (*EgressOnlyInternetGateway) ElementType() reflect.Type {
return reflect.TypeOf((*EgressOnlyInternetGateway)(nil))
}
func (i *EgressOnlyInternetGateway) ToEgressOnlyInternetGatewayOutput() EgressOnlyInternetGatewayOutput {
return i.ToEgressOnlyInternetGatewayOutputWithContext(context.Background())
}
func (i *EgressOnlyInternetGateway) ToEgressOnlyInternetGatewayOutputWithContext(ctx context.Context) EgressOnlyInternetGatewayOutput {
return pulumi.ToOutputWithContext(ctx, i).(EgressOnlyInternetGatewayOutput)
}
func (i *EgressOnlyInternetGateway) ToEgressOnlyInternetGatewayPtrOutput() EgressOnlyInternetGatewayPtrOutput {
return i.ToEgressOnlyInternetGatewayPtrOutputWithContext(context.Background())
}
func (i *EgressOnlyInternetGateway) ToEgressOnlyInternetGatewayPtrOutputWithContext(ctx context.Context) EgressOnlyInternetGatewayPtrOutput {
return pulumi.ToOutputWithContext(ctx, i).(EgressOnlyInternetGatewayPtrOutput)
}
type EgressOnlyInternetGatewayPtrInput interface {
pulumi.Input
ToEgressOnlyInternetGatewayPtrOutput() EgressOnlyInternetGatewayPtrOutput
ToEgressOnlyInternetGatewayPtrOutputWithContext(ctx context.Context) EgressOnlyInternetGatewayPtrOutput
}
type egressOnlyInternetGatewayPtrType EgressOnlyInternetGatewayArgs
func (*egressOnlyInternetGatewayPtrType) ElementType() reflect.Type {
return reflect.TypeOf((**EgressOnlyInternetGateway)(nil))
}
func (i *egressOnlyInternetGatewayPtrType) ToEgressOnlyInternetGatewayPtrOutput() EgressOnlyInternetGatewayPtrOutput {
return i.ToEgressOnlyInternetGatewayPtrOutputWithContext(context.Background())
}
func (i *egressOnlyInternetGatewayPtrType) ToEgressOnlyInternetGatewayPtrOutputWithContext(ctx context.Context) EgressOnlyInternetGatewayPtrOutput {
return pulumi.ToOutputWithContext(ctx, i).(EgressOnlyInternetGatewayPtrOutput)
}
// EgressOnlyInternetGatewayArrayInput is an input type that accepts EgressOnlyInternetGatewayArray and EgressOnlyInternetGatewayArrayOutput values.
// You can construct a concrete instance of `EgressOnlyInternetGatewayArrayInput` via:
//
// EgressOnlyInternetGatewayArray{ EgressOnlyInternetGatewayArgs{...} }
type EgressOnlyInternetGatewayArrayInput interface {
pulumi.Input
ToEgressOnlyInternetGatewayArrayOutput() EgressOnlyInternetGatewayArrayOutput
ToEgressOnlyInternetGatewayArrayOutputWithContext(context.Context) EgressOnlyInternetGatewayArrayOutput
}
type EgressOnlyInternetGatewayArray []EgressOnlyInternetGatewayInput
func (EgressOnlyInternetGatewayArray) ElementType() reflect.Type {
return reflect.TypeOf(([]*EgressOnlyInternetGateway)(nil))
}
func (i EgressOnlyInternetGatewayArray) ToEgressOnlyInternetGatewayArrayOutput() EgressOnlyInternetGatewayArrayOutput {
return i.ToEgressOnlyInternetGatewayArrayOutputWithContext(context.Background())
}
func (i EgressOnlyInternetGatewayArray) ToEgressOnlyInternetGatewayArrayOutputWithContext(ctx context.Context) EgressOnlyInternetGatewayArrayOutput {
return pulumi.ToOutputWithContext(ctx, i).(EgressOnlyInternetGatewayArrayOutput)
}
// EgressOnlyInternetGatewayMapInput is an input type that accepts EgressOnlyInternetGatewayMap and EgressOnlyInternetGatewayMapOutput values.
// You can construct a concrete instance of `EgressOnlyInternetGatewayMapInput` via:
//
// EgressOnlyInternetGatewayMap{ "key": EgressOnlyInternetGatewayArgs{...} }
type EgressOnlyInternetGatewayMapInput interface {
pulumi.Input
ToEgressOnlyInternetGatewayMapOutput() EgressOnlyInternetGatewayMapOutput
ToEgressOnlyInternetGatewayMapOutputWithContext(context.Context) EgressOnlyInternetGatewayMapOutput
}
type EgressOnlyInternetGatewayMap map[string]EgressOnlyInternetGatewayInput
func (EgressOnlyInternetGatewayMap) ElementType() reflect.Type {
return reflect.TypeOf((map[string]*EgressOnlyInternetGateway)(nil))
}
func (i EgressOnlyInternetGatewayMap) ToEgressOnlyInternetGatewayMapOutput() EgressOnlyInternetGatewayMapOutput {
return i.ToEgressOnlyInternetGatewayMapOutputWithContext(context.Background())
}
func (i EgressOnlyInternetGatewayMap) ToEgressOnlyInternetGatewayMapOutputWithContext(ctx context.Context) EgressOnlyInternetGatewayMapOutput {
return pulumi.ToOutputWithContext(ctx, i).(EgressOnlyInternetGatewayMapOutput)
}
type EgressOnlyInternetGatewayOutput struct {
*pulumi.OutputState
}
func (EgressOnlyInternetGatewayOutput) ElementType() reflect.Type {
return reflect.TypeOf((*EgressOnlyInternetGateway)(nil))
}
func (o EgressOnlyInternetGatewayOutput) ToEgressOnlyInternetGatewayOutput() EgressOnlyInternetGatewayOutput {
return o
}
func (o EgressOnlyInternetGatewayOutput) ToEgressOnlyInternetGatewayOutputWithContext(ctx context.Context) EgressOnlyInternetGatewayOutput {
return o
}
func (o EgressOnlyInternetGatewayOutput) ToEgressOnlyInternetGatewayPtrOutput() EgressOnlyInternetGatewayPtrOutput {
return o.ToEgressOnlyInternetGatewayPtrOutputWithContext(context.Background())
}
func (o EgressOnlyInternetGatewayOutput) ToEgressOnlyInternetGatewayPtrOutputWithContext(ctx context.Context) EgressOnlyInternetGatewayPtrOutput {
return o.ApplyT(func(v EgressOnlyInternetGateway) *EgressOnlyInternetGateway {
return &v
}).(EgressOnlyInternetGatewayPtrOutput)
}
type EgressOnlyInternetGatewayPtrOutput struct {
*pulumi.OutputState
}
func (EgressOnlyInternetGatewayPtrOutput) ElementType() reflect.Type {
return reflect.TypeOf((**EgressOnlyInternetGateway)(nil))
}
func (o EgressOnlyInternetGatewayPtrOutput) ToEgressOnlyInternetGatewayPtrOutput() EgressOnlyInternetGatewayPtrOutput {
return o
}
func (o EgressOnlyInternetGatewayPtrOutput) ToEgressOnlyInternetGatewayPtrOutputWithContext(ctx context.Context) EgressOnlyInternetGatewayPtrOutput {
return o
}
type EgressOnlyInternetGatewayArrayOutput struct{ *pulumi.OutputState }
func (EgressOnlyInternetGatewayArrayOutput) ElementType() reflect.Type {
return reflect.TypeOf((*[]EgressOnlyInternetGateway)(nil))
}
func (o EgressOnlyInternetGatewayArrayOutput) ToEgressOnlyInternetGatewayArrayOutput() EgressOnlyInternetGatewayArrayOutput {
return o
}
func (o EgressOnlyInternetGatewayArrayOutput) ToEgressOnlyInternetGatewayArrayOutputWithContext(ctx context.Context) EgressOnlyInternetGatewayArrayOutput {
return o
}
func (o EgressOnlyInternetGatewayArrayOutput) Index(i pulumi.IntInput) EgressOnlyInternetGatewayOutput {
return pulumi.All(o, i).ApplyT(func(vs []interface{}) EgressOnlyInternetGateway {
return vs[0].([]EgressOnlyInternetGateway)[vs[1].(int)]
}).(EgressOnlyInternetGatewayOutput)
}
type EgressOnlyInternetGatewayMapOutput struct{ *pulumi.OutputState }
func (EgressOnlyInternetGatewayMapOutput) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]EgressOnlyInternetGateway)(nil))
}
func (o EgressOnlyInternetGatewayMapOutput) ToEgressOnlyInternetGatewayMapOutput() EgressOnlyInternetGatewayMapOutput {
return o
}
func (o EgressOnlyInternetGatewayMapOutput) ToEgressOnlyInternetGatewayMapOutputWithContext(ctx context.Context) EgressOnlyInternetGatewayMapOutput {
return o
}
func (o EgressOnlyInternetGatewayMapOutput) MapIndex(k pulumi.StringInput) EgressOnlyInternetGatewayOutput {
return pulumi.All(o, k).ApplyT(func(vs []interface{}) EgressOnlyInternetGateway {
return vs[0].(map[string]EgressOnlyInternetGateway)[vs[1].(string)]
}).(EgressOnlyInternetGatewayOutput)
}
func init() {
pulumi.RegisterOutputType(EgressOnlyInternetGatewayOutput{})
pulumi.RegisterOutputType(EgressOnlyInternetGatewayPtrOutput{})
pulumi.RegisterOutputType(EgressOnlyInternetGatewayArrayOutput{})
pulumi.RegisterOutputType(EgressOnlyInternetGatewayMapOutput{})
}