/
transitGateway.go
388 lines (328 loc) · 16.9 KB
/
transitGateway.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
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
// *** 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 ec2transitgateway
import (
"context"
"reflect"
"github.com/pulumi/pulumi/sdk/v2/go/pulumi"
)
// Manages an EC2 Transit Gateway.
//
// ## Example Usage
//
// ```go
// package main
//
// import (
// "github.com/pulumi/pulumi-aws/sdk/v3/go/aws/ec2transitgateway"
// "github.com/pulumi/pulumi/sdk/v2/go/pulumi"
// )
//
// func main() {
// pulumi.Run(func(ctx *pulumi.Context) error {
// _, err := ec2transitgateway.NewTransitGateway(ctx, "example", &ec2transitgateway.TransitGatewayArgs{
// Description: pulumi.String("example"),
// })
// if err != nil {
// return err
// }
// return nil
// })
// }
// ```
//
// ## Import
//
// `aws_ec2_transit_gateway` can be imported by using the EC2 Transit Gateway identifier, e.g.
//
// ```sh
// $ pulumi import aws:ec2transitgateway/transitGateway:TransitGateway example tgw-12345678
// ```
type TransitGateway struct {
pulumi.CustomResourceState
// Private Autonomous System Number (ASN) for the Amazon side of a BGP session. The range is `64512` to `65534` for 16-bit ASNs and `4200000000` to `4294967294` for 32-bit ASNs. Default value: `64512`.
AmazonSideAsn pulumi.IntPtrOutput `pulumi:"amazonSideAsn"`
// EC2 Transit Gateway Amazon Resource Name (ARN)
Arn pulumi.StringOutput `pulumi:"arn"`
// Identifier of the default association route table
AssociationDefaultRouteTableId pulumi.StringOutput `pulumi:"associationDefaultRouteTableId"`
// Whether resource attachment requests are automatically accepted. Valid values: `disable`, `enable`. Default value: `disable`.
AutoAcceptSharedAttachments pulumi.StringPtrOutput `pulumi:"autoAcceptSharedAttachments"`
// Whether resource attachments are automatically associated with the default association route table. Valid values: `disable`, `enable`. Default value: `enable`.
DefaultRouteTableAssociation pulumi.StringPtrOutput `pulumi:"defaultRouteTableAssociation"`
// Whether resource attachments automatically propagate routes to the default propagation route table. Valid values: `disable`, `enable`. Default value: `enable`.
DefaultRouteTablePropagation pulumi.StringPtrOutput `pulumi:"defaultRouteTablePropagation"`
// Description of the EC2 Transit Gateway.
Description pulumi.StringPtrOutput `pulumi:"description"`
// Whether DNS support is enabled. Valid values: `disable`, `enable`. Default value: `enable`.
DnsSupport pulumi.StringPtrOutput `pulumi:"dnsSupport"`
// Identifier of the AWS account that owns the EC2 Transit Gateway
OwnerId pulumi.StringOutput `pulumi:"ownerId"`
// Identifier of the default propagation route table
PropagationDefaultRouteTableId pulumi.StringOutput `pulumi:"propagationDefaultRouteTableId"`
// Key-value tags for the EC2 Transit Gateway.
Tags pulumi.StringMapOutput `pulumi:"tags"`
// Whether VPN Equal Cost Multipath Protocol support is enabled. Valid values: `disable`, `enable`. Default value: `enable`.
VpnEcmpSupport pulumi.StringPtrOutput `pulumi:"vpnEcmpSupport"`
}
// NewTransitGateway registers a new resource with the given unique name, arguments, and options.
func NewTransitGateway(ctx *pulumi.Context,
name string, args *TransitGatewayArgs, opts ...pulumi.ResourceOption) (*TransitGateway, error) {
if args == nil {
args = &TransitGatewayArgs{}
}
var resource TransitGateway
err := ctx.RegisterResource("aws:ec2transitgateway/transitGateway:TransitGateway", name, args, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// GetTransitGateway gets an existing TransitGateway 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 GetTransitGateway(ctx *pulumi.Context,
name string, id pulumi.IDInput, state *TransitGatewayState, opts ...pulumi.ResourceOption) (*TransitGateway, error) {
var resource TransitGateway
err := ctx.ReadResource("aws:ec2transitgateway/transitGateway:TransitGateway", name, id, state, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// Input properties used for looking up and filtering TransitGateway resources.
type transitGatewayState struct {
// Private Autonomous System Number (ASN) for the Amazon side of a BGP session. The range is `64512` to `65534` for 16-bit ASNs and `4200000000` to `4294967294` for 32-bit ASNs. Default value: `64512`.
AmazonSideAsn *int `pulumi:"amazonSideAsn"`
// EC2 Transit Gateway Amazon Resource Name (ARN)
Arn *string `pulumi:"arn"`
// Identifier of the default association route table
AssociationDefaultRouteTableId *string `pulumi:"associationDefaultRouteTableId"`
// Whether resource attachment requests are automatically accepted. Valid values: `disable`, `enable`. Default value: `disable`.
AutoAcceptSharedAttachments *string `pulumi:"autoAcceptSharedAttachments"`
// Whether resource attachments are automatically associated with the default association route table. Valid values: `disable`, `enable`. Default value: `enable`.
DefaultRouteTableAssociation *string `pulumi:"defaultRouteTableAssociation"`
// Whether resource attachments automatically propagate routes to the default propagation route table. Valid values: `disable`, `enable`. Default value: `enable`.
DefaultRouteTablePropagation *string `pulumi:"defaultRouteTablePropagation"`
// Description of the EC2 Transit Gateway.
Description *string `pulumi:"description"`
// Whether DNS support is enabled. Valid values: `disable`, `enable`. Default value: `enable`.
DnsSupport *string `pulumi:"dnsSupport"`
// Identifier of the AWS account that owns the EC2 Transit Gateway
OwnerId *string `pulumi:"ownerId"`
// Identifier of the default propagation route table
PropagationDefaultRouteTableId *string `pulumi:"propagationDefaultRouteTableId"`
// Key-value tags for the EC2 Transit Gateway.
Tags map[string]string `pulumi:"tags"`
// Whether VPN Equal Cost Multipath Protocol support is enabled. Valid values: `disable`, `enable`. Default value: `enable`.
VpnEcmpSupport *string `pulumi:"vpnEcmpSupport"`
}
type TransitGatewayState struct {
// Private Autonomous System Number (ASN) for the Amazon side of a BGP session. The range is `64512` to `65534` for 16-bit ASNs and `4200000000` to `4294967294` for 32-bit ASNs. Default value: `64512`.
AmazonSideAsn pulumi.IntPtrInput
// EC2 Transit Gateway Amazon Resource Name (ARN)
Arn pulumi.StringPtrInput
// Identifier of the default association route table
AssociationDefaultRouteTableId pulumi.StringPtrInput
// Whether resource attachment requests are automatically accepted. Valid values: `disable`, `enable`. Default value: `disable`.
AutoAcceptSharedAttachments pulumi.StringPtrInput
// Whether resource attachments are automatically associated with the default association route table. Valid values: `disable`, `enable`. Default value: `enable`.
DefaultRouteTableAssociation pulumi.StringPtrInput
// Whether resource attachments automatically propagate routes to the default propagation route table. Valid values: `disable`, `enable`. Default value: `enable`.
DefaultRouteTablePropagation pulumi.StringPtrInput
// Description of the EC2 Transit Gateway.
Description pulumi.StringPtrInput
// Whether DNS support is enabled. Valid values: `disable`, `enable`. Default value: `enable`.
DnsSupport pulumi.StringPtrInput
// Identifier of the AWS account that owns the EC2 Transit Gateway
OwnerId pulumi.StringPtrInput
// Identifier of the default propagation route table
PropagationDefaultRouteTableId pulumi.StringPtrInput
// Key-value tags for the EC2 Transit Gateway.
Tags pulumi.StringMapInput
// Whether VPN Equal Cost Multipath Protocol support is enabled. Valid values: `disable`, `enable`. Default value: `enable`.
VpnEcmpSupport pulumi.StringPtrInput
}
func (TransitGatewayState) ElementType() reflect.Type {
return reflect.TypeOf((*transitGatewayState)(nil)).Elem()
}
type transitGatewayArgs struct {
// Private Autonomous System Number (ASN) for the Amazon side of a BGP session. The range is `64512` to `65534` for 16-bit ASNs and `4200000000` to `4294967294` for 32-bit ASNs. Default value: `64512`.
AmazonSideAsn *int `pulumi:"amazonSideAsn"`
// Whether resource attachment requests are automatically accepted. Valid values: `disable`, `enable`. Default value: `disable`.
AutoAcceptSharedAttachments *string `pulumi:"autoAcceptSharedAttachments"`
// Whether resource attachments are automatically associated with the default association route table. Valid values: `disable`, `enable`. Default value: `enable`.
DefaultRouteTableAssociation *string `pulumi:"defaultRouteTableAssociation"`
// Whether resource attachments automatically propagate routes to the default propagation route table. Valid values: `disable`, `enable`. Default value: `enable`.
DefaultRouteTablePropagation *string `pulumi:"defaultRouteTablePropagation"`
// Description of the EC2 Transit Gateway.
Description *string `pulumi:"description"`
// Whether DNS support is enabled. Valid values: `disable`, `enable`. Default value: `enable`.
DnsSupport *string `pulumi:"dnsSupport"`
// Key-value tags for the EC2 Transit Gateway.
Tags map[string]string `pulumi:"tags"`
// Whether VPN Equal Cost Multipath Protocol support is enabled. Valid values: `disable`, `enable`. Default value: `enable`.
VpnEcmpSupport *string `pulumi:"vpnEcmpSupport"`
}
// The set of arguments for constructing a TransitGateway resource.
type TransitGatewayArgs struct {
// Private Autonomous System Number (ASN) for the Amazon side of a BGP session. The range is `64512` to `65534` for 16-bit ASNs and `4200000000` to `4294967294` for 32-bit ASNs. Default value: `64512`.
AmazonSideAsn pulumi.IntPtrInput
// Whether resource attachment requests are automatically accepted. Valid values: `disable`, `enable`. Default value: `disable`.
AutoAcceptSharedAttachments pulumi.StringPtrInput
// Whether resource attachments are automatically associated with the default association route table. Valid values: `disable`, `enable`. Default value: `enable`.
DefaultRouteTableAssociation pulumi.StringPtrInput
// Whether resource attachments automatically propagate routes to the default propagation route table. Valid values: `disable`, `enable`. Default value: `enable`.
DefaultRouteTablePropagation pulumi.StringPtrInput
// Description of the EC2 Transit Gateway.
Description pulumi.StringPtrInput
// Whether DNS support is enabled. Valid values: `disable`, `enable`. Default value: `enable`.
DnsSupport pulumi.StringPtrInput
// Key-value tags for the EC2 Transit Gateway.
Tags pulumi.StringMapInput
// Whether VPN Equal Cost Multipath Protocol support is enabled. Valid values: `disable`, `enable`. Default value: `enable`.
VpnEcmpSupport pulumi.StringPtrInput
}
func (TransitGatewayArgs) ElementType() reflect.Type {
return reflect.TypeOf((*transitGatewayArgs)(nil)).Elem()
}
type TransitGatewayInput interface {
pulumi.Input
ToTransitGatewayOutput() TransitGatewayOutput
ToTransitGatewayOutputWithContext(ctx context.Context) TransitGatewayOutput
}
func (*TransitGateway) ElementType() reflect.Type {
return reflect.TypeOf((*TransitGateway)(nil))
}
func (i *TransitGateway) ToTransitGatewayOutput() TransitGatewayOutput {
return i.ToTransitGatewayOutputWithContext(context.Background())
}
func (i *TransitGateway) ToTransitGatewayOutputWithContext(ctx context.Context) TransitGatewayOutput {
return pulumi.ToOutputWithContext(ctx, i).(TransitGatewayOutput)
}
func (i *TransitGateway) ToTransitGatewayPtrOutput() TransitGatewayPtrOutput {
return i.ToTransitGatewayPtrOutputWithContext(context.Background())
}
func (i *TransitGateway) ToTransitGatewayPtrOutputWithContext(ctx context.Context) TransitGatewayPtrOutput {
return pulumi.ToOutputWithContext(ctx, i).(TransitGatewayPtrOutput)
}
type TransitGatewayPtrInput interface {
pulumi.Input
ToTransitGatewayPtrOutput() TransitGatewayPtrOutput
ToTransitGatewayPtrOutputWithContext(ctx context.Context) TransitGatewayPtrOutput
}
type transitGatewayPtrType TransitGatewayArgs
func (*transitGatewayPtrType) ElementType() reflect.Type {
return reflect.TypeOf((**TransitGateway)(nil))
}
func (i *transitGatewayPtrType) ToTransitGatewayPtrOutput() TransitGatewayPtrOutput {
return i.ToTransitGatewayPtrOutputWithContext(context.Background())
}
func (i *transitGatewayPtrType) ToTransitGatewayPtrOutputWithContext(ctx context.Context) TransitGatewayPtrOutput {
return pulumi.ToOutputWithContext(ctx, i).(TransitGatewayPtrOutput)
}
// TransitGatewayArrayInput is an input type that accepts TransitGatewayArray and TransitGatewayArrayOutput values.
// You can construct a concrete instance of `TransitGatewayArrayInput` via:
//
// TransitGatewayArray{ TransitGatewayArgs{...} }
type TransitGatewayArrayInput interface {
pulumi.Input
ToTransitGatewayArrayOutput() TransitGatewayArrayOutput
ToTransitGatewayArrayOutputWithContext(context.Context) TransitGatewayArrayOutput
}
type TransitGatewayArray []TransitGatewayInput
func (TransitGatewayArray) ElementType() reflect.Type {
return reflect.TypeOf(([]*TransitGateway)(nil))
}
func (i TransitGatewayArray) ToTransitGatewayArrayOutput() TransitGatewayArrayOutput {
return i.ToTransitGatewayArrayOutputWithContext(context.Background())
}
func (i TransitGatewayArray) ToTransitGatewayArrayOutputWithContext(ctx context.Context) TransitGatewayArrayOutput {
return pulumi.ToOutputWithContext(ctx, i).(TransitGatewayArrayOutput)
}
// TransitGatewayMapInput is an input type that accepts TransitGatewayMap and TransitGatewayMapOutput values.
// You can construct a concrete instance of `TransitGatewayMapInput` via:
//
// TransitGatewayMap{ "key": TransitGatewayArgs{...} }
type TransitGatewayMapInput interface {
pulumi.Input
ToTransitGatewayMapOutput() TransitGatewayMapOutput
ToTransitGatewayMapOutputWithContext(context.Context) TransitGatewayMapOutput
}
type TransitGatewayMap map[string]TransitGatewayInput
func (TransitGatewayMap) ElementType() reflect.Type {
return reflect.TypeOf((map[string]*TransitGateway)(nil))
}
func (i TransitGatewayMap) ToTransitGatewayMapOutput() TransitGatewayMapOutput {
return i.ToTransitGatewayMapOutputWithContext(context.Background())
}
func (i TransitGatewayMap) ToTransitGatewayMapOutputWithContext(ctx context.Context) TransitGatewayMapOutput {
return pulumi.ToOutputWithContext(ctx, i).(TransitGatewayMapOutput)
}
type TransitGatewayOutput struct {
*pulumi.OutputState
}
func (TransitGatewayOutput) ElementType() reflect.Type {
return reflect.TypeOf((*TransitGateway)(nil))
}
func (o TransitGatewayOutput) ToTransitGatewayOutput() TransitGatewayOutput {
return o
}
func (o TransitGatewayOutput) ToTransitGatewayOutputWithContext(ctx context.Context) TransitGatewayOutput {
return o
}
func (o TransitGatewayOutput) ToTransitGatewayPtrOutput() TransitGatewayPtrOutput {
return o.ToTransitGatewayPtrOutputWithContext(context.Background())
}
func (o TransitGatewayOutput) ToTransitGatewayPtrOutputWithContext(ctx context.Context) TransitGatewayPtrOutput {
return o.ApplyT(func(v TransitGateway) *TransitGateway {
return &v
}).(TransitGatewayPtrOutput)
}
type TransitGatewayPtrOutput struct {
*pulumi.OutputState
}
func (TransitGatewayPtrOutput) ElementType() reflect.Type {
return reflect.TypeOf((**TransitGateway)(nil))
}
func (o TransitGatewayPtrOutput) ToTransitGatewayPtrOutput() TransitGatewayPtrOutput {
return o
}
func (o TransitGatewayPtrOutput) ToTransitGatewayPtrOutputWithContext(ctx context.Context) TransitGatewayPtrOutput {
return o
}
type TransitGatewayArrayOutput struct{ *pulumi.OutputState }
func (TransitGatewayArrayOutput) ElementType() reflect.Type {
return reflect.TypeOf((*[]TransitGateway)(nil))
}
func (o TransitGatewayArrayOutput) ToTransitGatewayArrayOutput() TransitGatewayArrayOutput {
return o
}
func (o TransitGatewayArrayOutput) ToTransitGatewayArrayOutputWithContext(ctx context.Context) TransitGatewayArrayOutput {
return o
}
func (o TransitGatewayArrayOutput) Index(i pulumi.IntInput) TransitGatewayOutput {
return pulumi.All(o, i).ApplyT(func(vs []interface{}) TransitGateway {
return vs[0].([]TransitGateway)[vs[1].(int)]
}).(TransitGatewayOutput)
}
type TransitGatewayMapOutput struct{ *pulumi.OutputState }
func (TransitGatewayMapOutput) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]TransitGateway)(nil))
}
func (o TransitGatewayMapOutput) ToTransitGatewayMapOutput() TransitGatewayMapOutput {
return o
}
func (o TransitGatewayMapOutput) ToTransitGatewayMapOutputWithContext(ctx context.Context) TransitGatewayMapOutput {
return o
}
func (o TransitGatewayMapOutput) MapIndex(k pulumi.StringInput) TransitGatewayOutput {
return pulumi.All(o, k).ApplyT(func(vs []interface{}) TransitGateway {
return vs[0].(map[string]TransitGateway)[vs[1].(string)]
}).(TransitGatewayOutput)
}
func init() {
pulumi.RegisterOutputType(TransitGatewayOutput{})
pulumi.RegisterOutputType(TransitGatewayPtrOutput{})
pulumi.RegisterOutputType(TransitGatewayArrayOutput{})
pulumi.RegisterOutputType(TransitGatewayMapOutput{})
}