generated from pulumi/pulumi-tf-provider-boilerplate
/
sslVpnServer.go
432 lines (375 loc) · 18.1 KB
/
sslVpnServer.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
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
// 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 vpn
import (
"context"
"reflect"
"github.com/pkg/errors"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
// ## Example Usage
//
// # Basic Usage
//
// ```go
// package main
//
// import (
//
// "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
// "github.com/rhysmdnz/pulumi-alicloud/sdk/go/alicloud/vpn"
//
// )
//
// func main() {
// pulumi.Run(func(ctx *pulumi.Context) error {
// fooGateway, err := vpn.NewGateway(ctx, "fooGateway", &vpn.GatewayArgs{
// VpcId: pulumi.String("vpc-fake-id"),
// Bandwidth: pulumi.Int(10),
// EnableSsl: pulumi.Bool(true),
// InstanceChargeType: pulumi.String("PostPaid"),
// Description: pulumi.String("test_create_description"),
// })
// if err != nil {
// return err
// }
// _, err = vpn.NewSslVpnServer(ctx, "fooSslVpnServer", &vpn.SslVpnServerArgs{
// VpnGatewayId: fooGateway.ID(),
// ClientIpPool: pulumi.String("192.168.0.0/16"),
// LocalSubnet: pulumi.String("172.16.0.0/21"),
// Protocol: pulumi.String("UDP"),
// Cipher: pulumi.String("AES-128-CBC"),
// Port: pulumi.Int(1194),
// Compress: pulumi.Bool(false),
// })
// if err != nil {
// return err
// }
// return nil
// })
// }
//
// ```
//
// ## Import
//
// SSL-VPN server can be imported using the id, e.g.
//
// ```sh
//
// $ pulumi import alicloud:vpn/sslVpnServer:SslVpnServer example vss-abc123456
//
// ```
type SslVpnServer struct {
pulumi.CustomResourceState
// The encryption algorithm that is used in the SSL-VPN connection. Valid values: `AES-128-CBC`,`AES-192-CBC`,`AES-256-CBC`,`none`. Default value: `AES-128-CBC`.
// * `AES-128-CBC` - the AES-128-CBC algorithm.
// * `AES-192-CBC` - the AES-192-CBC algorithm.
// * `AES-256-CBC` - the AES-256-CBC algorithm.
Cipher pulumi.StringPtrOutput `pulumi:"cipher"`
// The CIDR block from which access addresses are allocated to the virtual network interface card of the client.
ClientIpPool pulumi.StringOutput `pulumi:"clientIpPool"`
// Specifies whether to enable data compression. Valid values: `true`,`false`. Default value: `false`
Compress pulumi.BoolPtrOutput `pulumi:"compress"`
// The number of current connections.
Connections pulumi.IntOutput `pulumi:"connections"`
// The internet IP of the SSL-VPN server.
InternetIp pulumi.StringOutput `pulumi:"internetIp"`
// The CIDR block to be accessed by the client through the SSL-VPN connection. It supports to set multi CIDRs by comma join ways, like `10.0.1.0/24,10.0.2.0/24,10.0.3.0/24`.
LocalSubnet pulumi.StringOutput `pulumi:"localSubnet"`
// The maximum number of connections.
MaxConnections pulumi.IntOutput `pulumi:"maxConnections"`
// The name of the SSL-VPN server.
Name pulumi.StringOutput `pulumi:"name"`
// The port used by the SSL-VPN server. The default value is `1194`.The following ports cannot be used: [22, 2222, 22222, 9000, 9001, 9002, 7505, 80, 443, 53, 68, 123, 4510, 4560, 500, 4500].
Port pulumi.IntPtrOutput `pulumi:"port"`
// The protocol used by the SSL-VPN server. Valid value: UDP(default) |TCP
Protocol pulumi.StringPtrOutput `pulumi:"protocol"`
// The ID of the VPN gateway.
VpnGatewayId pulumi.StringOutput `pulumi:"vpnGatewayId"`
}
// NewSslVpnServer registers a new resource with the given unique name, arguments, and options.
func NewSslVpnServer(ctx *pulumi.Context,
name string, args *SslVpnServerArgs, opts ...pulumi.ResourceOption) (*SslVpnServer, error) {
if args == nil {
return nil, errors.New("missing one or more required arguments")
}
if args.ClientIpPool == nil {
return nil, errors.New("invalid value for required argument 'ClientIpPool'")
}
if args.LocalSubnet == nil {
return nil, errors.New("invalid value for required argument 'LocalSubnet'")
}
if args.VpnGatewayId == nil {
return nil, errors.New("invalid value for required argument 'VpnGatewayId'")
}
opts = pkgResourceDefaultOpts(opts)
var resource SslVpnServer
err := ctx.RegisterResource("alicloud:vpn/sslVpnServer:SslVpnServer", name, args, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// GetSslVpnServer gets an existing SslVpnServer 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 GetSslVpnServer(ctx *pulumi.Context,
name string, id pulumi.IDInput, state *SslVpnServerState, opts ...pulumi.ResourceOption) (*SslVpnServer, error) {
var resource SslVpnServer
err := ctx.ReadResource("alicloud:vpn/sslVpnServer:SslVpnServer", name, id, state, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// Input properties used for looking up and filtering SslVpnServer resources.
type sslVpnServerState struct {
// The encryption algorithm that is used in the SSL-VPN connection. Valid values: `AES-128-CBC`,`AES-192-CBC`,`AES-256-CBC`,`none`. Default value: `AES-128-CBC`.
// * `AES-128-CBC` - the AES-128-CBC algorithm.
// * `AES-192-CBC` - the AES-192-CBC algorithm.
// * `AES-256-CBC` - the AES-256-CBC algorithm.
Cipher *string `pulumi:"cipher"`
// The CIDR block from which access addresses are allocated to the virtual network interface card of the client.
ClientIpPool *string `pulumi:"clientIpPool"`
// Specifies whether to enable data compression. Valid values: `true`,`false`. Default value: `false`
Compress *bool `pulumi:"compress"`
// The number of current connections.
Connections *int `pulumi:"connections"`
// The internet IP of the SSL-VPN server.
InternetIp *string `pulumi:"internetIp"`
// The CIDR block to be accessed by the client through the SSL-VPN connection. It supports to set multi CIDRs by comma join ways, like `10.0.1.0/24,10.0.2.0/24,10.0.3.0/24`.
LocalSubnet *string `pulumi:"localSubnet"`
// The maximum number of connections.
MaxConnections *int `pulumi:"maxConnections"`
// The name of the SSL-VPN server.
Name *string `pulumi:"name"`
// The port used by the SSL-VPN server. The default value is `1194`.The following ports cannot be used: [22, 2222, 22222, 9000, 9001, 9002, 7505, 80, 443, 53, 68, 123, 4510, 4560, 500, 4500].
Port *int `pulumi:"port"`
// The protocol used by the SSL-VPN server. Valid value: UDP(default) |TCP
Protocol *string `pulumi:"protocol"`
// The ID of the VPN gateway.
VpnGatewayId *string `pulumi:"vpnGatewayId"`
}
type SslVpnServerState struct {
// The encryption algorithm that is used in the SSL-VPN connection. Valid values: `AES-128-CBC`,`AES-192-CBC`,`AES-256-CBC`,`none`. Default value: `AES-128-CBC`.
// * `AES-128-CBC` - the AES-128-CBC algorithm.
// * `AES-192-CBC` - the AES-192-CBC algorithm.
// * `AES-256-CBC` - the AES-256-CBC algorithm.
Cipher pulumi.StringPtrInput
// The CIDR block from which access addresses are allocated to the virtual network interface card of the client.
ClientIpPool pulumi.StringPtrInput
// Specifies whether to enable data compression. Valid values: `true`,`false`. Default value: `false`
Compress pulumi.BoolPtrInput
// The number of current connections.
Connections pulumi.IntPtrInput
// The internet IP of the SSL-VPN server.
InternetIp pulumi.StringPtrInput
// The CIDR block to be accessed by the client through the SSL-VPN connection. It supports to set multi CIDRs by comma join ways, like `10.0.1.0/24,10.0.2.0/24,10.0.3.0/24`.
LocalSubnet pulumi.StringPtrInput
// The maximum number of connections.
MaxConnections pulumi.IntPtrInput
// The name of the SSL-VPN server.
Name pulumi.StringPtrInput
// The port used by the SSL-VPN server. The default value is `1194`.The following ports cannot be used: [22, 2222, 22222, 9000, 9001, 9002, 7505, 80, 443, 53, 68, 123, 4510, 4560, 500, 4500].
Port pulumi.IntPtrInput
// The protocol used by the SSL-VPN server. Valid value: UDP(default) |TCP
Protocol pulumi.StringPtrInput
// The ID of the VPN gateway.
VpnGatewayId pulumi.StringPtrInput
}
func (SslVpnServerState) ElementType() reflect.Type {
return reflect.TypeOf((*sslVpnServerState)(nil)).Elem()
}
type sslVpnServerArgs struct {
// The encryption algorithm that is used in the SSL-VPN connection. Valid values: `AES-128-CBC`,`AES-192-CBC`,`AES-256-CBC`,`none`. Default value: `AES-128-CBC`.
// * `AES-128-CBC` - the AES-128-CBC algorithm.
// * `AES-192-CBC` - the AES-192-CBC algorithm.
// * `AES-256-CBC` - the AES-256-CBC algorithm.
Cipher *string `pulumi:"cipher"`
// The CIDR block from which access addresses are allocated to the virtual network interface card of the client.
ClientIpPool string `pulumi:"clientIpPool"`
// Specifies whether to enable data compression. Valid values: `true`,`false`. Default value: `false`
Compress *bool `pulumi:"compress"`
// The CIDR block to be accessed by the client through the SSL-VPN connection. It supports to set multi CIDRs by comma join ways, like `10.0.1.0/24,10.0.2.0/24,10.0.3.0/24`.
LocalSubnet string `pulumi:"localSubnet"`
// The name of the SSL-VPN server.
Name *string `pulumi:"name"`
// The port used by the SSL-VPN server. The default value is `1194`.The following ports cannot be used: [22, 2222, 22222, 9000, 9001, 9002, 7505, 80, 443, 53, 68, 123, 4510, 4560, 500, 4500].
Port *int `pulumi:"port"`
// The protocol used by the SSL-VPN server. Valid value: UDP(default) |TCP
Protocol *string `pulumi:"protocol"`
// The ID of the VPN gateway.
VpnGatewayId string `pulumi:"vpnGatewayId"`
}
// The set of arguments for constructing a SslVpnServer resource.
type SslVpnServerArgs struct {
// The encryption algorithm that is used in the SSL-VPN connection. Valid values: `AES-128-CBC`,`AES-192-CBC`,`AES-256-CBC`,`none`. Default value: `AES-128-CBC`.
// * `AES-128-CBC` - the AES-128-CBC algorithm.
// * `AES-192-CBC` - the AES-192-CBC algorithm.
// * `AES-256-CBC` - the AES-256-CBC algorithm.
Cipher pulumi.StringPtrInput
// The CIDR block from which access addresses are allocated to the virtual network interface card of the client.
ClientIpPool pulumi.StringInput
// Specifies whether to enable data compression. Valid values: `true`,`false`. Default value: `false`
Compress pulumi.BoolPtrInput
// The CIDR block to be accessed by the client through the SSL-VPN connection. It supports to set multi CIDRs by comma join ways, like `10.0.1.0/24,10.0.2.0/24,10.0.3.0/24`.
LocalSubnet pulumi.StringInput
// The name of the SSL-VPN server.
Name pulumi.StringPtrInput
// The port used by the SSL-VPN server. The default value is `1194`.The following ports cannot be used: [22, 2222, 22222, 9000, 9001, 9002, 7505, 80, 443, 53, 68, 123, 4510, 4560, 500, 4500].
Port pulumi.IntPtrInput
// The protocol used by the SSL-VPN server. Valid value: UDP(default) |TCP
Protocol pulumi.StringPtrInput
// The ID of the VPN gateway.
VpnGatewayId pulumi.StringInput
}
func (SslVpnServerArgs) ElementType() reflect.Type {
return reflect.TypeOf((*sslVpnServerArgs)(nil)).Elem()
}
type SslVpnServerInput interface {
pulumi.Input
ToSslVpnServerOutput() SslVpnServerOutput
ToSslVpnServerOutputWithContext(ctx context.Context) SslVpnServerOutput
}
func (*SslVpnServer) ElementType() reflect.Type {
return reflect.TypeOf((**SslVpnServer)(nil)).Elem()
}
func (i *SslVpnServer) ToSslVpnServerOutput() SslVpnServerOutput {
return i.ToSslVpnServerOutputWithContext(context.Background())
}
func (i *SslVpnServer) ToSslVpnServerOutputWithContext(ctx context.Context) SslVpnServerOutput {
return pulumi.ToOutputWithContext(ctx, i).(SslVpnServerOutput)
}
// SslVpnServerArrayInput is an input type that accepts SslVpnServerArray and SslVpnServerArrayOutput values.
// You can construct a concrete instance of `SslVpnServerArrayInput` via:
//
// SslVpnServerArray{ SslVpnServerArgs{...} }
type SslVpnServerArrayInput interface {
pulumi.Input
ToSslVpnServerArrayOutput() SslVpnServerArrayOutput
ToSslVpnServerArrayOutputWithContext(context.Context) SslVpnServerArrayOutput
}
type SslVpnServerArray []SslVpnServerInput
func (SslVpnServerArray) ElementType() reflect.Type {
return reflect.TypeOf((*[]*SslVpnServer)(nil)).Elem()
}
func (i SslVpnServerArray) ToSslVpnServerArrayOutput() SslVpnServerArrayOutput {
return i.ToSslVpnServerArrayOutputWithContext(context.Background())
}
func (i SslVpnServerArray) ToSslVpnServerArrayOutputWithContext(ctx context.Context) SslVpnServerArrayOutput {
return pulumi.ToOutputWithContext(ctx, i).(SslVpnServerArrayOutput)
}
// SslVpnServerMapInput is an input type that accepts SslVpnServerMap and SslVpnServerMapOutput values.
// You can construct a concrete instance of `SslVpnServerMapInput` via:
//
// SslVpnServerMap{ "key": SslVpnServerArgs{...} }
type SslVpnServerMapInput interface {
pulumi.Input
ToSslVpnServerMapOutput() SslVpnServerMapOutput
ToSslVpnServerMapOutputWithContext(context.Context) SslVpnServerMapOutput
}
type SslVpnServerMap map[string]SslVpnServerInput
func (SslVpnServerMap) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*SslVpnServer)(nil)).Elem()
}
func (i SslVpnServerMap) ToSslVpnServerMapOutput() SslVpnServerMapOutput {
return i.ToSslVpnServerMapOutputWithContext(context.Background())
}
func (i SslVpnServerMap) ToSslVpnServerMapOutputWithContext(ctx context.Context) SslVpnServerMapOutput {
return pulumi.ToOutputWithContext(ctx, i).(SslVpnServerMapOutput)
}
type SslVpnServerOutput struct{ *pulumi.OutputState }
func (SslVpnServerOutput) ElementType() reflect.Type {
return reflect.TypeOf((**SslVpnServer)(nil)).Elem()
}
func (o SslVpnServerOutput) ToSslVpnServerOutput() SslVpnServerOutput {
return o
}
func (o SslVpnServerOutput) ToSslVpnServerOutputWithContext(ctx context.Context) SslVpnServerOutput {
return o
}
// The encryption algorithm that is used in the SSL-VPN connection. Valid values: `AES-128-CBC`,`AES-192-CBC`,`AES-256-CBC`,`none`. Default value: `AES-128-CBC`.
// * `AES-128-CBC` - the AES-128-CBC algorithm.
// * `AES-192-CBC` - the AES-192-CBC algorithm.
// * `AES-256-CBC` - the AES-256-CBC algorithm.
func (o SslVpnServerOutput) Cipher() pulumi.StringPtrOutput {
return o.ApplyT(func(v *SslVpnServer) pulumi.StringPtrOutput { return v.Cipher }).(pulumi.StringPtrOutput)
}
// The CIDR block from which access addresses are allocated to the virtual network interface card of the client.
func (o SslVpnServerOutput) ClientIpPool() pulumi.StringOutput {
return o.ApplyT(func(v *SslVpnServer) pulumi.StringOutput { return v.ClientIpPool }).(pulumi.StringOutput)
}
// Specifies whether to enable data compression. Valid values: `true`,`false`. Default value: `false`
func (o SslVpnServerOutput) Compress() pulumi.BoolPtrOutput {
return o.ApplyT(func(v *SslVpnServer) pulumi.BoolPtrOutput { return v.Compress }).(pulumi.BoolPtrOutput)
}
// The number of current connections.
func (o SslVpnServerOutput) Connections() pulumi.IntOutput {
return o.ApplyT(func(v *SslVpnServer) pulumi.IntOutput { return v.Connections }).(pulumi.IntOutput)
}
// The internet IP of the SSL-VPN server.
func (o SslVpnServerOutput) InternetIp() pulumi.StringOutput {
return o.ApplyT(func(v *SslVpnServer) pulumi.StringOutput { return v.InternetIp }).(pulumi.StringOutput)
}
// The CIDR block to be accessed by the client through the SSL-VPN connection. It supports to set multi CIDRs by comma join ways, like `10.0.1.0/24,10.0.2.0/24,10.0.3.0/24`.
func (o SslVpnServerOutput) LocalSubnet() pulumi.StringOutput {
return o.ApplyT(func(v *SslVpnServer) pulumi.StringOutput { return v.LocalSubnet }).(pulumi.StringOutput)
}
// The maximum number of connections.
func (o SslVpnServerOutput) MaxConnections() pulumi.IntOutput {
return o.ApplyT(func(v *SslVpnServer) pulumi.IntOutput { return v.MaxConnections }).(pulumi.IntOutput)
}
// The name of the SSL-VPN server.
func (o SslVpnServerOutput) Name() pulumi.StringOutput {
return o.ApplyT(func(v *SslVpnServer) pulumi.StringOutput { return v.Name }).(pulumi.StringOutput)
}
// The port used by the SSL-VPN server. The default value is `1194`.The following ports cannot be used: [22, 2222, 22222, 9000, 9001, 9002, 7505, 80, 443, 53, 68, 123, 4510, 4560, 500, 4500].
func (o SslVpnServerOutput) Port() pulumi.IntPtrOutput {
return o.ApplyT(func(v *SslVpnServer) pulumi.IntPtrOutput { return v.Port }).(pulumi.IntPtrOutput)
}
// The protocol used by the SSL-VPN server. Valid value: UDP(default) |TCP
func (o SslVpnServerOutput) Protocol() pulumi.StringPtrOutput {
return o.ApplyT(func(v *SslVpnServer) pulumi.StringPtrOutput { return v.Protocol }).(pulumi.StringPtrOutput)
}
// The ID of the VPN gateway.
func (o SslVpnServerOutput) VpnGatewayId() pulumi.StringOutput {
return o.ApplyT(func(v *SslVpnServer) pulumi.StringOutput { return v.VpnGatewayId }).(pulumi.StringOutput)
}
type SslVpnServerArrayOutput struct{ *pulumi.OutputState }
func (SslVpnServerArrayOutput) ElementType() reflect.Type {
return reflect.TypeOf((*[]*SslVpnServer)(nil)).Elem()
}
func (o SslVpnServerArrayOutput) ToSslVpnServerArrayOutput() SslVpnServerArrayOutput {
return o
}
func (o SslVpnServerArrayOutput) ToSslVpnServerArrayOutputWithContext(ctx context.Context) SslVpnServerArrayOutput {
return o
}
func (o SslVpnServerArrayOutput) Index(i pulumi.IntInput) SslVpnServerOutput {
return pulumi.All(o, i).ApplyT(func(vs []interface{}) *SslVpnServer {
return vs[0].([]*SslVpnServer)[vs[1].(int)]
}).(SslVpnServerOutput)
}
type SslVpnServerMapOutput struct{ *pulumi.OutputState }
func (SslVpnServerMapOutput) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*SslVpnServer)(nil)).Elem()
}
func (o SslVpnServerMapOutput) ToSslVpnServerMapOutput() SslVpnServerMapOutput {
return o
}
func (o SslVpnServerMapOutput) ToSslVpnServerMapOutputWithContext(ctx context.Context) SslVpnServerMapOutput {
return o
}
func (o SslVpnServerMapOutput) MapIndex(k pulumi.StringInput) SslVpnServerOutput {
return pulumi.All(o, k).ApplyT(func(vs []interface{}) *SslVpnServer {
return vs[0].(map[string]*SslVpnServer)[vs[1].(string)]
}).(SslVpnServerOutput)
}
func init() {
pulumi.RegisterInputType(reflect.TypeOf((*SslVpnServerInput)(nil)).Elem(), &SslVpnServer{})
pulumi.RegisterInputType(reflect.TypeOf((*SslVpnServerArrayInput)(nil)).Elem(), SslVpnServerArray{})
pulumi.RegisterInputType(reflect.TypeOf((*SslVpnServerMapInput)(nil)).Elem(), SslVpnServerMap{})
pulumi.RegisterOutputType(SslVpnServerOutput{})
pulumi.RegisterOutputType(SslVpnServerArrayOutput{})
pulumi.RegisterOutputType(SslVpnServerMapOutput{})
}