/
routeEntry.go
333 lines (273 loc) · 12.1 KB
/
routeEntry.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
// *** 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 vpc
import (
"context"
"reflect"
"github.com/pkg/errors"
"github.com/pulumi/pulumi/sdk/v2/go/pulumi"
)
// ## Import
//
// Router entry can be imported using the id, e.g (formatted as<route_table_id:router_id:destination_cidrblock:nexthop_type:nexthop_id>).
//
// ```sh
// $ pulumi import alicloud:vpc/routeEntry:RouteEntry example vtb-123456:vrt-123456:0.0.0.0/0:NatGateway:ngw-123456
// ```
type RouteEntry struct {
pulumi.CustomResourceState
// The RouteEntry's target network segment.
DestinationCidrblock pulumi.StringPtrOutput `pulumi:"destinationCidrblock"`
// The name of the route entry. This name can have a string of 2 to 128 characters, must contain only alphanumeric characters or hyphens, such as "-",".","_", and must not begin or end with a hyphen, and must not begin with http:// or https://.
Name pulumi.StringOutput `pulumi:"name"`
// The route entry's next hop. ECS instance ID or VPC router interface ID.
NexthopId pulumi.StringPtrOutput `pulumi:"nexthopId"`
// The next hop type. Available values:
NexthopType pulumi.StringPtrOutput `pulumi:"nexthopType"`
// The ID of the route table.
RouteTableId pulumi.StringOutput `pulumi:"routeTableId"`
// This argument has beeb deprecated. Please use other arguments to launch a custom route entry.
//
// Deprecated: Attribute router_id has been deprecated and suggest removing it from your template.
RouterId pulumi.StringOutput `pulumi:"routerId"`
}
// NewRouteEntry registers a new resource with the given unique name, arguments, and options.
func NewRouteEntry(ctx *pulumi.Context,
name string, args *RouteEntryArgs, opts ...pulumi.ResourceOption) (*RouteEntry, error) {
if args == nil {
return nil, errors.New("missing one or more required arguments")
}
if args.RouteTableId == nil {
return nil, errors.New("invalid value for required argument 'RouteTableId'")
}
var resource RouteEntry
err := ctx.RegisterResource("alicloud:vpc/routeEntry:RouteEntry", name, args, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// GetRouteEntry gets an existing RouteEntry 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 GetRouteEntry(ctx *pulumi.Context,
name string, id pulumi.IDInput, state *RouteEntryState, opts ...pulumi.ResourceOption) (*RouteEntry, error) {
var resource RouteEntry
err := ctx.ReadResource("alicloud:vpc/routeEntry:RouteEntry", name, id, state, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// Input properties used for looking up and filtering RouteEntry resources.
type routeEntryState struct {
// The RouteEntry's target network segment.
DestinationCidrblock *string `pulumi:"destinationCidrblock"`
// The name of the route entry. This name can have a string of 2 to 128 characters, must contain only alphanumeric characters or hyphens, such as "-",".","_", and must not begin or end with a hyphen, and must not begin with http:// or https://.
Name *string `pulumi:"name"`
// The route entry's next hop. ECS instance ID or VPC router interface ID.
NexthopId *string `pulumi:"nexthopId"`
// The next hop type. Available values:
NexthopType *string `pulumi:"nexthopType"`
// The ID of the route table.
RouteTableId *string `pulumi:"routeTableId"`
// This argument has beeb deprecated. Please use other arguments to launch a custom route entry.
//
// Deprecated: Attribute router_id has been deprecated and suggest removing it from your template.
RouterId *string `pulumi:"routerId"`
}
type RouteEntryState struct {
// The RouteEntry's target network segment.
DestinationCidrblock pulumi.StringPtrInput
// The name of the route entry. This name can have a string of 2 to 128 characters, must contain only alphanumeric characters or hyphens, such as "-",".","_", and must not begin or end with a hyphen, and must not begin with http:// or https://.
Name pulumi.StringPtrInput
// The route entry's next hop. ECS instance ID or VPC router interface ID.
NexthopId pulumi.StringPtrInput
// The next hop type. Available values:
NexthopType pulumi.StringPtrInput
// The ID of the route table.
RouteTableId pulumi.StringPtrInput
// This argument has beeb deprecated. Please use other arguments to launch a custom route entry.
//
// Deprecated: Attribute router_id has been deprecated and suggest removing it from your template.
RouterId pulumi.StringPtrInput
}
func (RouteEntryState) ElementType() reflect.Type {
return reflect.TypeOf((*routeEntryState)(nil)).Elem()
}
type routeEntryArgs struct {
// The RouteEntry's target network segment.
DestinationCidrblock *string `pulumi:"destinationCidrblock"`
// The name of the route entry. This name can have a string of 2 to 128 characters, must contain only alphanumeric characters or hyphens, such as "-",".","_", and must not begin or end with a hyphen, and must not begin with http:// or https://.
Name *string `pulumi:"name"`
// The route entry's next hop. ECS instance ID or VPC router interface ID.
NexthopId *string `pulumi:"nexthopId"`
// The next hop type. Available values:
NexthopType *string `pulumi:"nexthopType"`
// The ID of the route table.
RouteTableId string `pulumi:"routeTableId"`
// This argument has beeb deprecated. Please use other arguments to launch a custom route entry.
//
// Deprecated: Attribute router_id has been deprecated and suggest removing it from your template.
RouterId *string `pulumi:"routerId"`
}
// The set of arguments for constructing a RouteEntry resource.
type RouteEntryArgs struct {
// The RouteEntry's target network segment.
DestinationCidrblock pulumi.StringPtrInput
// The name of the route entry. This name can have a string of 2 to 128 characters, must contain only alphanumeric characters or hyphens, such as "-",".","_", and must not begin or end with a hyphen, and must not begin with http:// or https://.
Name pulumi.StringPtrInput
// The route entry's next hop. ECS instance ID or VPC router interface ID.
NexthopId pulumi.StringPtrInput
// The next hop type. Available values:
NexthopType pulumi.StringPtrInput
// The ID of the route table.
RouteTableId pulumi.StringInput
// This argument has beeb deprecated. Please use other arguments to launch a custom route entry.
//
// Deprecated: Attribute router_id has been deprecated and suggest removing it from your template.
RouterId pulumi.StringPtrInput
}
func (RouteEntryArgs) ElementType() reflect.Type {
return reflect.TypeOf((*routeEntryArgs)(nil)).Elem()
}
type RouteEntryInput interface {
pulumi.Input
ToRouteEntryOutput() RouteEntryOutput
ToRouteEntryOutputWithContext(ctx context.Context) RouteEntryOutput
}
func (*RouteEntry) ElementType() reflect.Type {
return reflect.TypeOf((*RouteEntry)(nil))
}
func (i *RouteEntry) ToRouteEntryOutput() RouteEntryOutput {
return i.ToRouteEntryOutputWithContext(context.Background())
}
func (i *RouteEntry) ToRouteEntryOutputWithContext(ctx context.Context) RouteEntryOutput {
return pulumi.ToOutputWithContext(ctx, i).(RouteEntryOutput)
}
func (i *RouteEntry) ToRouteEntryPtrOutput() RouteEntryPtrOutput {
return i.ToRouteEntryPtrOutputWithContext(context.Background())
}
func (i *RouteEntry) ToRouteEntryPtrOutputWithContext(ctx context.Context) RouteEntryPtrOutput {
return pulumi.ToOutputWithContext(ctx, i).(RouteEntryPtrOutput)
}
type RouteEntryPtrInput interface {
pulumi.Input
ToRouteEntryPtrOutput() RouteEntryPtrOutput
ToRouteEntryPtrOutputWithContext(ctx context.Context) RouteEntryPtrOutput
}
type routeEntryPtrType RouteEntryArgs
func (*routeEntryPtrType) ElementType() reflect.Type {
return reflect.TypeOf((**RouteEntry)(nil))
}
func (i *routeEntryPtrType) ToRouteEntryPtrOutput() RouteEntryPtrOutput {
return i.ToRouteEntryPtrOutputWithContext(context.Background())
}
func (i *routeEntryPtrType) ToRouteEntryPtrOutputWithContext(ctx context.Context) RouteEntryPtrOutput {
return pulumi.ToOutputWithContext(ctx, i).(RouteEntryPtrOutput)
}
// RouteEntryArrayInput is an input type that accepts RouteEntryArray and RouteEntryArrayOutput values.
// You can construct a concrete instance of `RouteEntryArrayInput` via:
//
// RouteEntryArray{ RouteEntryArgs{...} }
type RouteEntryArrayInput interface {
pulumi.Input
ToRouteEntryArrayOutput() RouteEntryArrayOutput
ToRouteEntryArrayOutputWithContext(context.Context) RouteEntryArrayOutput
}
type RouteEntryArray []RouteEntryInput
func (RouteEntryArray) ElementType() reflect.Type {
return reflect.TypeOf(([]*RouteEntry)(nil))
}
func (i RouteEntryArray) ToRouteEntryArrayOutput() RouteEntryArrayOutput {
return i.ToRouteEntryArrayOutputWithContext(context.Background())
}
func (i RouteEntryArray) ToRouteEntryArrayOutputWithContext(ctx context.Context) RouteEntryArrayOutput {
return pulumi.ToOutputWithContext(ctx, i).(RouteEntryArrayOutput)
}
// RouteEntryMapInput is an input type that accepts RouteEntryMap and RouteEntryMapOutput values.
// You can construct a concrete instance of `RouteEntryMapInput` via:
//
// RouteEntryMap{ "key": RouteEntryArgs{...} }
type RouteEntryMapInput interface {
pulumi.Input
ToRouteEntryMapOutput() RouteEntryMapOutput
ToRouteEntryMapOutputWithContext(context.Context) RouteEntryMapOutput
}
type RouteEntryMap map[string]RouteEntryInput
func (RouteEntryMap) ElementType() reflect.Type {
return reflect.TypeOf((map[string]*RouteEntry)(nil))
}
func (i RouteEntryMap) ToRouteEntryMapOutput() RouteEntryMapOutput {
return i.ToRouteEntryMapOutputWithContext(context.Background())
}
func (i RouteEntryMap) ToRouteEntryMapOutputWithContext(ctx context.Context) RouteEntryMapOutput {
return pulumi.ToOutputWithContext(ctx, i).(RouteEntryMapOutput)
}
type RouteEntryOutput struct {
*pulumi.OutputState
}
func (RouteEntryOutput) ElementType() reflect.Type {
return reflect.TypeOf((*RouteEntry)(nil))
}
func (o RouteEntryOutput) ToRouteEntryOutput() RouteEntryOutput {
return o
}
func (o RouteEntryOutput) ToRouteEntryOutputWithContext(ctx context.Context) RouteEntryOutput {
return o
}
func (o RouteEntryOutput) ToRouteEntryPtrOutput() RouteEntryPtrOutput {
return o.ToRouteEntryPtrOutputWithContext(context.Background())
}
func (o RouteEntryOutput) ToRouteEntryPtrOutputWithContext(ctx context.Context) RouteEntryPtrOutput {
return o.ApplyT(func(v RouteEntry) *RouteEntry {
return &v
}).(RouteEntryPtrOutput)
}
type RouteEntryPtrOutput struct {
*pulumi.OutputState
}
func (RouteEntryPtrOutput) ElementType() reflect.Type {
return reflect.TypeOf((**RouteEntry)(nil))
}
func (o RouteEntryPtrOutput) ToRouteEntryPtrOutput() RouteEntryPtrOutput {
return o
}
func (o RouteEntryPtrOutput) ToRouteEntryPtrOutputWithContext(ctx context.Context) RouteEntryPtrOutput {
return o
}
type RouteEntryArrayOutput struct{ *pulumi.OutputState }
func (RouteEntryArrayOutput) ElementType() reflect.Type {
return reflect.TypeOf((*[]RouteEntry)(nil))
}
func (o RouteEntryArrayOutput) ToRouteEntryArrayOutput() RouteEntryArrayOutput {
return o
}
func (o RouteEntryArrayOutput) ToRouteEntryArrayOutputWithContext(ctx context.Context) RouteEntryArrayOutput {
return o
}
func (o RouteEntryArrayOutput) Index(i pulumi.IntInput) RouteEntryOutput {
return pulumi.All(o, i).ApplyT(func(vs []interface{}) RouteEntry {
return vs[0].([]RouteEntry)[vs[1].(int)]
}).(RouteEntryOutput)
}
type RouteEntryMapOutput struct{ *pulumi.OutputState }
func (RouteEntryMapOutput) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]RouteEntry)(nil))
}
func (o RouteEntryMapOutput) ToRouteEntryMapOutput() RouteEntryMapOutput {
return o
}
func (o RouteEntryMapOutput) ToRouteEntryMapOutputWithContext(ctx context.Context) RouteEntryMapOutput {
return o
}
func (o RouteEntryMapOutput) MapIndex(k pulumi.StringInput) RouteEntryOutput {
return pulumi.All(o, k).ApplyT(func(vs []interface{}) RouteEntry {
return vs[0].(map[string]RouteEntry)[vs[1].(string)]
}).(RouteEntryOutput)
}
func init() {
pulumi.RegisterOutputType(RouteEntryOutput{})
pulumi.RegisterOutputType(RouteEntryPtrOutput{})
pulumi.RegisterOutputType(RouteEntryArrayOutput{})
pulumi.RegisterOutputType(RouteEntryMapOutput{})
}