/
prefixListReference.go
356 lines (305 loc) · 13.3 KB
/
prefixListReference.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
// Code generated by the Pulumi Terraform Bridge (tfgen) Tool DO NOT EDIT.
// *** WARNING: Do not edit by hand unless you're certain you know what you are doing! ***
package ec2transitgateway
import (
"context"
"reflect"
"errors"
"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/internal"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
// Manages an EC2 Transit Gateway Prefix List Reference.
//
// ## Example Usage
//
// ### Attachment Routing
//
// <!--Start PulumiCodeChooser -->
// ```go
// package main
//
// import (
//
// "github.com/pulumi/pulumi-aws/sdk/v6/go/aws/ec2transitgateway"
// "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
//
// )
//
// func main() {
// pulumi.Run(func(ctx *pulumi.Context) error {
// _, err := ec2transitgateway.NewPrefixListReference(ctx, "example", &ec2transitgateway.PrefixListReferenceArgs{
// PrefixListId: pulumi.Any(exampleAwsEc2ManagedPrefixList.Id),
// TransitGatewayAttachmentId: pulumi.Any(exampleAwsEc2TransitGatewayVpcAttachment.Id),
// TransitGatewayRouteTableId: pulumi.Any(exampleAwsEc2TransitGateway.AssociationDefaultRouteTableId),
// })
// if err != nil {
// return err
// }
// return nil
// })
// }
//
// ```
// <!--End PulumiCodeChooser -->
//
// ### Blackhole Routing
//
// <!--Start PulumiCodeChooser -->
// ```go
// package main
//
// import (
//
// "github.com/pulumi/pulumi-aws/sdk/v6/go/aws/ec2transitgateway"
// "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
//
// )
//
// func main() {
// pulumi.Run(func(ctx *pulumi.Context) error {
// _, err := ec2transitgateway.NewPrefixListReference(ctx, "example", &ec2transitgateway.PrefixListReferenceArgs{
// Blackhole: pulumi.Bool(true),
// PrefixListId: pulumi.Any(exampleAwsEc2ManagedPrefixList.Id),
// TransitGatewayRouteTableId: pulumi.Any(exampleAwsEc2TransitGateway.AssociationDefaultRouteTableId),
// })
// if err != nil {
// return err
// }
// return nil
// })
// }
//
// ```
// <!--End PulumiCodeChooser -->
//
// ## Import
//
// Using `pulumi import`, import `aws_ec2_transit_gateway_prefix_list_reference` using the EC2 Transit Gateway Route Table identifier and EC2 Prefix List identifier, separated by an underscore (`_`). For example:
//
// ```sh
// $ pulumi import aws:ec2transitgateway/prefixListReference:PrefixListReference example tgw-rtb-12345678_pl-12345678
// ```
type PrefixListReference struct {
pulumi.CustomResourceState
// Indicates whether to drop traffic that matches the Prefix List. Defaults to `false`.
Blackhole pulumi.BoolPtrOutput `pulumi:"blackhole"`
// Identifier of EC2 Prefix List.
PrefixListId pulumi.StringOutput `pulumi:"prefixListId"`
PrefixListOwnerId pulumi.StringOutput `pulumi:"prefixListOwnerId"`
// Identifier of EC2 Transit Gateway Attachment.
TransitGatewayAttachmentId pulumi.StringPtrOutput `pulumi:"transitGatewayAttachmentId"`
// Identifier of EC2 Transit Gateway Route Table.
//
// The following arguments are optional:
TransitGatewayRouteTableId pulumi.StringOutput `pulumi:"transitGatewayRouteTableId"`
}
// NewPrefixListReference registers a new resource with the given unique name, arguments, and options.
func NewPrefixListReference(ctx *pulumi.Context,
name string, args *PrefixListReferenceArgs, opts ...pulumi.ResourceOption) (*PrefixListReference, error) {
if args == nil {
return nil, errors.New("missing one or more required arguments")
}
if args.PrefixListId == nil {
return nil, errors.New("invalid value for required argument 'PrefixListId'")
}
if args.TransitGatewayRouteTableId == nil {
return nil, errors.New("invalid value for required argument 'TransitGatewayRouteTableId'")
}
opts = internal.PkgResourceDefaultOpts(opts)
var resource PrefixListReference
err := ctx.RegisterResource("aws:ec2transitgateway/prefixListReference:PrefixListReference", name, args, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// GetPrefixListReference gets an existing PrefixListReference 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 GetPrefixListReference(ctx *pulumi.Context,
name string, id pulumi.IDInput, state *PrefixListReferenceState, opts ...pulumi.ResourceOption) (*PrefixListReference, error) {
var resource PrefixListReference
err := ctx.ReadResource("aws:ec2transitgateway/prefixListReference:PrefixListReference", name, id, state, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// Input properties used for looking up and filtering PrefixListReference resources.
type prefixListReferenceState struct {
// Indicates whether to drop traffic that matches the Prefix List. Defaults to `false`.
Blackhole *bool `pulumi:"blackhole"`
// Identifier of EC2 Prefix List.
PrefixListId *string `pulumi:"prefixListId"`
PrefixListOwnerId *string `pulumi:"prefixListOwnerId"`
// Identifier of EC2 Transit Gateway Attachment.
TransitGatewayAttachmentId *string `pulumi:"transitGatewayAttachmentId"`
// Identifier of EC2 Transit Gateway Route Table.
//
// The following arguments are optional:
TransitGatewayRouteTableId *string `pulumi:"transitGatewayRouteTableId"`
}
type PrefixListReferenceState struct {
// Indicates whether to drop traffic that matches the Prefix List. Defaults to `false`.
Blackhole pulumi.BoolPtrInput
// Identifier of EC2 Prefix List.
PrefixListId pulumi.StringPtrInput
PrefixListOwnerId pulumi.StringPtrInput
// Identifier of EC2 Transit Gateway Attachment.
TransitGatewayAttachmentId pulumi.StringPtrInput
// Identifier of EC2 Transit Gateway Route Table.
//
// The following arguments are optional:
TransitGatewayRouteTableId pulumi.StringPtrInput
}
func (PrefixListReferenceState) ElementType() reflect.Type {
return reflect.TypeOf((*prefixListReferenceState)(nil)).Elem()
}
type prefixListReferenceArgs struct {
// Indicates whether to drop traffic that matches the Prefix List. Defaults to `false`.
Blackhole *bool `pulumi:"blackhole"`
// Identifier of EC2 Prefix List.
PrefixListId string `pulumi:"prefixListId"`
// Identifier of EC2 Transit Gateway Attachment.
TransitGatewayAttachmentId *string `pulumi:"transitGatewayAttachmentId"`
// Identifier of EC2 Transit Gateway Route Table.
//
// The following arguments are optional:
TransitGatewayRouteTableId string `pulumi:"transitGatewayRouteTableId"`
}
// The set of arguments for constructing a PrefixListReference resource.
type PrefixListReferenceArgs struct {
// Indicates whether to drop traffic that matches the Prefix List. Defaults to `false`.
Blackhole pulumi.BoolPtrInput
// Identifier of EC2 Prefix List.
PrefixListId pulumi.StringInput
// Identifier of EC2 Transit Gateway Attachment.
TransitGatewayAttachmentId pulumi.StringPtrInput
// Identifier of EC2 Transit Gateway Route Table.
//
// The following arguments are optional:
TransitGatewayRouteTableId pulumi.StringInput
}
func (PrefixListReferenceArgs) ElementType() reflect.Type {
return reflect.TypeOf((*prefixListReferenceArgs)(nil)).Elem()
}
type PrefixListReferenceInput interface {
pulumi.Input
ToPrefixListReferenceOutput() PrefixListReferenceOutput
ToPrefixListReferenceOutputWithContext(ctx context.Context) PrefixListReferenceOutput
}
func (*PrefixListReference) ElementType() reflect.Type {
return reflect.TypeOf((**PrefixListReference)(nil)).Elem()
}
func (i *PrefixListReference) ToPrefixListReferenceOutput() PrefixListReferenceOutput {
return i.ToPrefixListReferenceOutputWithContext(context.Background())
}
func (i *PrefixListReference) ToPrefixListReferenceOutputWithContext(ctx context.Context) PrefixListReferenceOutput {
return pulumi.ToOutputWithContext(ctx, i).(PrefixListReferenceOutput)
}
// PrefixListReferenceArrayInput is an input type that accepts PrefixListReferenceArray and PrefixListReferenceArrayOutput values.
// You can construct a concrete instance of `PrefixListReferenceArrayInput` via:
//
// PrefixListReferenceArray{ PrefixListReferenceArgs{...} }
type PrefixListReferenceArrayInput interface {
pulumi.Input
ToPrefixListReferenceArrayOutput() PrefixListReferenceArrayOutput
ToPrefixListReferenceArrayOutputWithContext(context.Context) PrefixListReferenceArrayOutput
}
type PrefixListReferenceArray []PrefixListReferenceInput
func (PrefixListReferenceArray) ElementType() reflect.Type {
return reflect.TypeOf((*[]*PrefixListReference)(nil)).Elem()
}
func (i PrefixListReferenceArray) ToPrefixListReferenceArrayOutput() PrefixListReferenceArrayOutput {
return i.ToPrefixListReferenceArrayOutputWithContext(context.Background())
}
func (i PrefixListReferenceArray) ToPrefixListReferenceArrayOutputWithContext(ctx context.Context) PrefixListReferenceArrayOutput {
return pulumi.ToOutputWithContext(ctx, i).(PrefixListReferenceArrayOutput)
}
// PrefixListReferenceMapInput is an input type that accepts PrefixListReferenceMap and PrefixListReferenceMapOutput values.
// You can construct a concrete instance of `PrefixListReferenceMapInput` via:
//
// PrefixListReferenceMap{ "key": PrefixListReferenceArgs{...} }
type PrefixListReferenceMapInput interface {
pulumi.Input
ToPrefixListReferenceMapOutput() PrefixListReferenceMapOutput
ToPrefixListReferenceMapOutputWithContext(context.Context) PrefixListReferenceMapOutput
}
type PrefixListReferenceMap map[string]PrefixListReferenceInput
func (PrefixListReferenceMap) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*PrefixListReference)(nil)).Elem()
}
func (i PrefixListReferenceMap) ToPrefixListReferenceMapOutput() PrefixListReferenceMapOutput {
return i.ToPrefixListReferenceMapOutputWithContext(context.Background())
}
func (i PrefixListReferenceMap) ToPrefixListReferenceMapOutputWithContext(ctx context.Context) PrefixListReferenceMapOutput {
return pulumi.ToOutputWithContext(ctx, i).(PrefixListReferenceMapOutput)
}
type PrefixListReferenceOutput struct{ *pulumi.OutputState }
func (PrefixListReferenceOutput) ElementType() reflect.Type {
return reflect.TypeOf((**PrefixListReference)(nil)).Elem()
}
func (o PrefixListReferenceOutput) ToPrefixListReferenceOutput() PrefixListReferenceOutput {
return o
}
func (o PrefixListReferenceOutput) ToPrefixListReferenceOutputWithContext(ctx context.Context) PrefixListReferenceOutput {
return o
}
// Indicates whether to drop traffic that matches the Prefix List. Defaults to `false`.
func (o PrefixListReferenceOutput) Blackhole() pulumi.BoolPtrOutput {
return o.ApplyT(func(v *PrefixListReference) pulumi.BoolPtrOutput { return v.Blackhole }).(pulumi.BoolPtrOutput)
}
// Identifier of EC2 Prefix List.
func (o PrefixListReferenceOutput) PrefixListId() pulumi.StringOutput {
return o.ApplyT(func(v *PrefixListReference) pulumi.StringOutput { return v.PrefixListId }).(pulumi.StringOutput)
}
func (o PrefixListReferenceOutput) PrefixListOwnerId() pulumi.StringOutput {
return o.ApplyT(func(v *PrefixListReference) pulumi.StringOutput { return v.PrefixListOwnerId }).(pulumi.StringOutput)
}
// Identifier of EC2 Transit Gateway Attachment.
func (o PrefixListReferenceOutput) TransitGatewayAttachmentId() pulumi.StringPtrOutput {
return o.ApplyT(func(v *PrefixListReference) pulumi.StringPtrOutput { return v.TransitGatewayAttachmentId }).(pulumi.StringPtrOutput)
}
// Identifier of EC2 Transit Gateway Route Table.
//
// The following arguments are optional:
func (o PrefixListReferenceOutput) TransitGatewayRouteTableId() pulumi.StringOutput {
return o.ApplyT(func(v *PrefixListReference) pulumi.StringOutput { return v.TransitGatewayRouteTableId }).(pulumi.StringOutput)
}
type PrefixListReferenceArrayOutput struct{ *pulumi.OutputState }
func (PrefixListReferenceArrayOutput) ElementType() reflect.Type {
return reflect.TypeOf((*[]*PrefixListReference)(nil)).Elem()
}
func (o PrefixListReferenceArrayOutput) ToPrefixListReferenceArrayOutput() PrefixListReferenceArrayOutput {
return o
}
func (o PrefixListReferenceArrayOutput) ToPrefixListReferenceArrayOutputWithContext(ctx context.Context) PrefixListReferenceArrayOutput {
return o
}
func (o PrefixListReferenceArrayOutput) Index(i pulumi.IntInput) PrefixListReferenceOutput {
return pulumi.All(o, i).ApplyT(func(vs []interface{}) *PrefixListReference {
return vs[0].([]*PrefixListReference)[vs[1].(int)]
}).(PrefixListReferenceOutput)
}
type PrefixListReferenceMapOutput struct{ *pulumi.OutputState }
func (PrefixListReferenceMapOutput) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*PrefixListReference)(nil)).Elem()
}
func (o PrefixListReferenceMapOutput) ToPrefixListReferenceMapOutput() PrefixListReferenceMapOutput {
return o
}
func (o PrefixListReferenceMapOutput) ToPrefixListReferenceMapOutputWithContext(ctx context.Context) PrefixListReferenceMapOutput {
return o
}
func (o PrefixListReferenceMapOutput) MapIndex(k pulumi.StringInput) PrefixListReferenceOutput {
return pulumi.All(o, k).ApplyT(func(vs []interface{}) *PrefixListReference {
return vs[0].(map[string]*PrefixListReference)[vs[1].(string)]
}).(PrefixListReferenceOutput)
}
func init() {
pulumi.RegisterInputType(reflect.TypeOf((*PrefixListReferenceInput)(nil)).Elem(), &PrefixListReference{})
pulumi.RegisterInputType(reflect.TypeOf((*PrefixListReferenceArrayInput)(nil)).Elem(), PrefixListReferenceArray{})
pulumi.RegisterInputType(reflect.TypeOf((*PrefixListReferenceMapInput)(nil)).Elem(), PrefixListReferenceMap{})
pulumi.RegisterOutputType(PrefixListReferenceOutput{})
pulumi.RegisterOutputType(PrefixListReferenceArrayOutput{})
pulumi.RegisterOutputType(PrefixListReferenceMapOutput{})
}