/
routeTablePropagation.go
296 lines (246 loc) · 11.5 KB
/
routeTablePropagation.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
// 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 Route Table propagation.
//
// ## Example Usage
//
// <!--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.NewRouteTablePropagation(ctx, "example", &ec2transitgateway.RouteTablePropagationArgs{
// TransitGatewayAttachmentId: pulumi.Any(exampleAwsEc2TransitGatewayVpcAttachment.Id),
// TransitGatewayRouteTableId: pulumi.Any(exampleAwsEc2TransitGatewayRouteTable.Id),
// })
// if err != nil {
// return err
// }
// return nil
// })
// }
//
// ```
// <!--End PulumiCodeChooser -->
//
// ## Import
//
// Using `pulumi import`, import `aws_ec2_transit_gateway_route_table_propagation` using the EC2 Transit Gateway Route Table identifier, an underscore, and the EC2 Transit Gateway Attachment identifier. For example:
//
// ```sh
// $ pulumi import aws:ec2transitgateway/routeTablePropagation:RouteTablePropagation example tgw-rtb-12345678_tgw-attach-87654321
// ```
type RouteTablePropagation struct {
pulumi.CustomResourceState
// Identifier of the resource
ResourceId pulumi.StringOutput `pulumi:"resourceId"`
// Type of the resource
ResourceType pulumi.StringOutput `pulumi:"resourceType"`
// Identifier of EC2 Transit Gateway Attachment.
TransitGatewayAttachmentId pulumi.StringOutput `pulumi:"transitGatewayAttachmentId"`
// Identifier of EC2 Transit Gateway Route Table.
TransitGatewayRouteTableId pulumi.StringOutput `pulumi:"transitGatewayRouteTableId"`
}
// NewRouteTablePropagation registers a new resource with the given unique name, arguments, and options.
func NewRouteTablePropagation(ctx *pulumi.Context,
name string, args *RouteTablePropagationArgs, opts ...pulumi.ResourceOption) (*RouteTablePropagation, error) {
if args == nil {
return nil, errors.New("missing one or more required arguments")
}
if args.TransitGatewayAttachmentId == nil {
return nil, errors.New("invalid value for required argument 'TransitGatewayAttachmentId'")
}
if args.TransitGatewayRouteTableId == nil {
return nil, errors.New("invalid value for required argument 'TransitGatewayRouteTableId'")
}
opts = internal.PkgResourceDefaultOpts(opts)
var resource RouteTablePropagation
err := ctx.RegisterResource("aws:ec2transitgateway/routeTablePropagation:RouteTablePropagation", name, args, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// GetRouteTablePropagation gets an existing RouteTablePropagation 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 GetRouteTablePropagation(ctx *pulumi.Context,
name string, id pulumi.IDInput, state *RouteTablePropagationState, opts ...pulumi.ResourceOption) (*RouteTablePropagation, error) {
var resource RouteTablePropagation
err := ctx.ReadResource("aws:ec2transitgateway/routeTablePropagation:RouteTablePropagation", name, id, state, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// Input properties used for looking up and filtering RouteTablePropagation resources.
type routeTablePropagationState struct {
// Identifier of the resource
ResourceId *string `pulumi:"resourceId"`
// Type of the resource
ResourceType *string `pulumi:"resourceType"`
// Identifier of EC2 Transit Gateway Attachment.
TransitGatewayAttachmentId *string `pulumi:"transitGatewayAttachmentId"`
// Identifier of EC2 Transit Gateway Route Table.
TransitGatewayRouteTableId *string `pulumi:"transitGatewayRouteTableId"`
}
type RouteTablePropagationState struct {
// Identifier of the resource
ResourceId pulumi.StringPtrInput
// Type of the resource
ResourceType pulumi.StringPtrInput
// Identifier of EC2 Transit Gateway Attachment.
TransitGatewayAttachmentId pulumi.StringPtrInput
// Identifier of EC2 Transit Gateway Route Table.
TransitGatewayRouteTableId pulumi.StringPtrInput
}
func (RouteTablePropagationState) ElementType() reflect.Type {
return reflect.TypeOf((*routeTablePropagationState)(nil)).Elem()
}
type routeTablePropagationArgs struct {
// Identifier of EC2 Transit Gateway Attachment.
TransitGatewayAttachmentId string `pulumi:"transitGatewayAttachmentId"`
// Identifier of EC2 Transit Gateway Route Table.
TransitGatewayRouteTableId string `pulumi:"transitGatewayRouteTableId"`
}
// The set of arguments for constructing a RouteTablePropagation resource.
type RouteTablePropagationArgs struct {
// Identifier of EC2 Transit Gateway Attachment.
TransitGatewayAttachmentId pulumi.StringInput
// Identifier of EC2 Transit Gateway Route Table.
TransitGatewayRouteTableId pulumi.StringInput
}
func (RouteTablePropagationArgs) ElementType() reflect.Type {
return reflect.TypeOf((*routeTablePropagationArgs)(nil)).Elem()
}
type RouteTablePropagationInput interface {
pulumi.Input
ToRouteTablePropagationOutput() RouteTablePropagationOutput
ToRouteTablePropagationOutputWithContext(ctx context.Context) RouteTablePropagationOutput
}
func (*RouteTablePropagation) ElementType() reflect.Type {
return reflect.TypeOf((**RouteTablePropagation)(nil)).Elem()
}
func (i *RouteTablePropagation) ToRouteTablePropagationOutput() RouteTablePropagationOutput {
return i.ToRouteTablePropagationOutputWithContext(context.Background())
}
func (i *RouteTablePropagation) ToRouteTablePropagationOutputWithContext(ctx context.Context) RouteTablePropagationOutput {
return pulumi.ToOutputWithContext(ctx, i).(RouteTablePropagationOutput)
}
// RouteTablePropagationArrayInput is an input type that accepts RouteTablePropagationArray and RouteTablePropagationArrayOutput values.
// You can construct a concrete instance of `RouteTablePropagationArrayInput` via:
//
// RouteTablePropagationArray{ RouteTablePropagationArgs{...} }
type RouteTablePropagationArrayInput interface {
pulumi.Input
ToRouteTablePropagationArrayOutput() RouteTablePropagationArrayOutput
ToRouteTablePropagationArrayOutputWithContext(context.Context) RouteTablePropagationArrayOutput
}
type RouteTablePropagationArray []RouteTablePropagationInput
func (RouteTablePropagationArray) ElementType() reflect.Type {
return reflect.TypeOf((*[]*RouteTablePropagation)(nil)).Elem()
}
func (i RouteTablePropagationArray) ToRouteTablePropagationArrayOutput() RouteTablePropagationArrayOutput {
return i.ToRouteTablePropagationArrayOutputWithContext(context.Background())
}
func (i RouteTablePropagationArray) ToRouteTablePropagationArrayOutputWithContext(ctx context.Context) RouteTablePropagationArrayOutput {
return pulumi.ToOutputWithContext(ctx, i).(RouteTablePropagationArrayOutput)
}
// RouteTablePropagationMapInput is an input type that accepts RouteTablePropagationMap and RouteTablePropagationMapOutput values.
// You can construct a concrete instance of `RouteTablePropagationMapInput` via:
//
// RouteTablePropagationMap{ "key": RouteTablePropagationArgs{...} }
type RouteTablePropagationMapInput interface {
pulumi.Input
ToRouteTablePropagationMapOutput() RouteTablePropagationMapOutput
ToRouteTablePropagationMapOutputWithContext(context.Context) RouteTablePropagationMapOutput
}
type RouteTablePropagationMap map[string]RouteTablePropagationInput
func (RouteTablePropagationMap) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*RouteTablePropagation)(nil)).Elem()
}
func (i RouteTablePropagationMap) ToRouteTablePropagationMapOutput() RouteTablePropagationMapOutput {
return i.ToRouteTablePropagationMapOutputWithContext(context.Background())
}
func (i RouteTablePropagationMap) ToRouteTablePropagationMapOutputWithContext(ctx context.Context) RouteTablePropagationMapOutput {
return pulumi.ToOutputWithContext(ctx, i).(RouteTablePropagationMapOutput)
}
type RouteTablePropagationOutput struct{ *pulumi.OutputState }
func (RouteTablePropagationOutput) ElementType() reflect.Type {
return reflect.TypeOf((**RouteTablePropagation)(nil)).Elem()
}
func (o RouteTablePropagationOutput) ToRouteTablePropagationOutput() RouteTablePropagationOutput {
return o
}
func (o RouteTablePropagationOutput) ToRouteTablePropagationOutputWithContext(ctx context.Context) RouteTablePropagationOutput {
return o
}
// Identifier of the resource
func (o RouteTablePropagationOutput) ResourceId() pulumi.StringOutput {
return o.ApplyT(func(v *RouteTablePropagation) pulumi.StringOutput { return v.ResourceId }).(pulumi.StringOutput)
}
// Type of the resource
func (o RouteTablePropagationOutput) ResourceType() pulumi.StringOutput {
return o.ApplyT(func(v *RouteTablePropagation) pulumi.StringOutput { return v.ResourceType }).(pulumi.StringOutput)
}
// Identifier of EC2 Transit Gateway Attachment.
func (o RouteTablePropagationOutput) TransitGatewayAttachmentId() pulumi.StringOutput {
return o.ApplyT(func(v *RouteTablePropagation) pulumi.StringOutput { return v.TransitGatewayAttachmentId }).(pulumi.StringOutput)
}
// Identifier of EC2 Transit Gateway Route Table.
func (o RouteTablePropagationOutput) TransitGatewayRouteTableId() pulumi.StringOutput {
return o.ApplyT(func(v *RouteTablePropagation) pulumi.StringOutput { return v.TransitGatewayRouteTableId }).(pulumi.StringOutput)
}
type RouteTablePropagationArrayOutput struct{ *pulumi.OutputState }
func (RouteTablePropagationArrayOutput) ElementType() reflect.Type {
return reflect.TypeOf((*[]*RouteTablePropagation)(nil)).Elem()
}
func (o RouteTablePropagationArrayOutput) ToRouteTablePropagationArrayOutput() RouteTablePropagationArrayOutput {
return o
}
func (o RouteTablePropagationArrayOutput) ToRouteTablePropagationArrayOutputWithContext(ctx context.Context) RouteTablePropagationArrayOutput {
return o
}
func (o RouteTablePropagationArrayOutput) Index(i pulumi.IntInput) RouteTablePropagationOutput {
return pulumi.All(o, i).ApplyT(func(vs []interface{}) *RouteTablePropagation {
return vs[0].([]*RouteTablePropagation)[vs[1].(int)]
}).(RouteTablePropagationOutput)
}
type RouteTablePropagationMapOutput struct{ *pulumi.OutputState }
func (RouteTablePropagationMapOutput) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*RouteTablePropagation)(nil)).Elem()
}
func (o RouteTablePropagationMapOutput) ToRouteTablePropagationMapOutput() RouteTablePropagationMapOutput {
return o
}
func (o RouteTablePropagationMapOutput) ToRouteTablePropagationMapOutputWithContext(ctx context.Context) RouteTablePropagationMapOutput {
return o
}
func (o RouteTablePropagationMapOutput) MapIndex(k pulumi.StringInput) RouteTablePropagationOutput {
return pulumi.All(o, k).ApplyT(func(vs []interface{}) *RouteTablePropagation {
return vs[0].(map[string]*RouteTablePropagation)[vs[1].(string)]
}).(RouteTablePropagationOutput)
}
func init() {
pulumi.RegisterInputType(reflect.TypeOf((*RouteTablePropagationInput)(nil)).Elem(), &RouteTablePropagation{})
pulumi.RegisterInputType(reflect.TypeOf((*RouteTablePropagationArrayInput)(nil)).Elem(), RouteTablePropagationArray{})
pulumi.RegisterInputType(reflect.TypeOf((*RouteTablePropagationMapInput)(nil)).Elem(), RouteTablePropagationMap{})
pulumi.RegisterOutputType(RouteTablePropagationOutput{})
pulumi.RegisterOutputType(RouteTablePropagationArrayOutput{})
pulumi.RegisterOutputType(RouteTablePropagationMapOutput{})
}