/
routeEntry.go
325 lines (265 loc) · 10.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
// *** 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 vpn
import (
"context"
"reflect"
"github.com/pkg/errors"
"github.com/pulumi/pulumi/sdk/v2/go/pulumi"
)
// ## Import
//
// VPN route entry can be imported using the id(VpnGatewayId +":"+ NextHop +":"+ RouteDest), e.g.
//
// ```sh
// $ pulumi import alicloud:vpn/routeEntry:RouteEntry example vpn-abc123456:vco-abc123456:10.0.0.10/24
// ```
type RouteEntry struct {
pulumi.CustomResourceState
// The next hop of the destination route.
NextHop pulumi.StringOutput `pulumi:"nextHop"`
// Whether to issue the destination route to the VPC.
PublishVpc pulumi.BoolOutput `pulumi:"publishVpc"`
// The destination network segment of the destination route.
RouteDest pulumi.StringOutput `pulumi:"routeDest"`
// The id of the vpn gateway.
VpnGatewayId pulumi.StringOutput `pulumi:"vpnGatewayId"`
// The value should be 0 or 100.
Weight pulumi.IntOutput `pulumi:"weight"`
}
// 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.NextHop == nil {
return nil, errors.New("invalid value for required argument 'NextHop'")
}
if args.PublishVpc == nil {
return nil, errors.New("invalid value for required argument 'PublishVpc'")
}
if args.RouteDest == nil {
return nil, errors.New("invalid value for required argument 'RouteDest'")
}
if args.VpnGatewayId == nil {
return nil, errors.New("invalid value for required argument 'VpnGatewayId'")
}
if args.Weight == nil {
return nil, errors.New("invalid value for required argument 'Weight'")
}
var resource RouteEntry
err := ctx.RegisterResource("alicloud:vpn/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:vpn/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 next hop of the destination route.
NextHop *string `pulumi:"nextHop"`
// Whether to issue the destination route to the VPC.
PublishVpc *bool `pulumi:"publishVpc"`
// The destination network segment of the destination route.
RouteDest *string `pulumi:"routeDest"`
// The id of the vpn gateway.
VpnGatewayId *string `pulumi:"vpnGatewayId"`
// The value should be 0 or 100.
Weight *int `pulumi:"weight"`
}
type RouteEntryState struct {
// The next hop of the destination route.
NextHop pulumi.StringPtrInput
// Whether to issue the destination route to the VPC.
PublishVpc pulumi.BoolPtrInput
// The destination network segment of the destination route.
RouteDest pulumi.StringPtrInput
// The id of the vpn gateway.
VpnGatewayId pulumi.StringPtrInput
// The value should be 0 or 100.
Weight pulumi.IntPtrInput
}
func (RouteEntryState) ElementType() reflect.Type {
return reflect.TypeOf((*routeEntryState)(nil)).Elem()
}
type routeEntryArgs struct {
// The next hop of the destination route.
NextHop string `pulumi:"nextHop"`
// Whether to issue the destination route to the VPC.
PublishVpc bool `pulumi:"publishVpc"`
// The destination network segment of the destination route.
RouteDest string `pulumi:"routeDest"`
// The id of the vpn gateway.
VpnGatewayId string `pulumi:"vpnGatewayId"`
// The value should be 0 or 100.
Weight int `pulumi:"weight"`
}
// The set of arguments for constructing a RouteEntry resource.
type RouteEntryArgs struct {
// The next hop of the destination route.
NextHop pulumi.StringInput
// Whether to issue the destination route to the VPC.
PublishVpc pulumi.BoolInput
// The destination network segment of the destination route.
RouteDest pulumi.StringInput
// The id of the vpn gateway.
VpnGatewayId pulumi.StringInput
// The value should be 0 or 100.
Weight pulumi.IntInput
}
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{})
}