/
route.go
594 lines (530 loc) · 27.1 KB
/
route.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
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
// 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 kong
import (
"context"
"reflect"
"errors"
"github.com/pulumi/pulumi-kong/sdk/v4/go/kong/internal"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
// ## # Route
//
// The route resource maps directly onto the json for the route endpoint in Kong. For more information on the parameters [see the Kong Route create documentation](https://docs.konghq.com/gateway-oss/2.5.x/admin-api/#route-object).
//
// To create a tcp/tls route you set `sources` and `destinations` by repeating the corresponding element (`source` or `destination`) for each source or destination you want.
//
// ## Example Usage
//
// <!--Start PulumiCodeChooser -->
// ```go
// package main
//
// import (
//
// "github.com/pulumi/pulumi-kong/sdk/v4/go/kong"
// "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
//
// )
//
// func main() {
// pulumi.Run(func(ctx *pulumi.Context) error {
// _, err := kong.NewRoute(ctx, "route", &kong.RouteArgs{
// Protocols: pulumi.StringArray{
// pulumi.String("http"),
// pulumi.String("https"),
// },
// Methods: pulumi.StringArray{
// pulumi.String("GET"),
// pulumi.String("POST"),
// },
// Hosts: pulumi.StringArray{
// pulumi.String("example2.com"),
// },
// Paths: pulumi.StringArray{
// pulumi.String("/test"),
// },
// StripPath: pulumi.Bool(false),
// PreserveHost: pulumi.Bool(true),
// RegexPriority: pulumi.Int(1),
// ServiceId: pulumi.Any(kong_service.Service.Id),
// Headers: kong.RouteHeaderArray{
// &kong.RouteHeaderArgs{
// Name: pulumi.String("x-test-1"),
// Values: pulumi.StringArray{
// pulumi.String("a"),
// pulumi.String("b"),
// },
// },
// },
// })
// if err != nil {
// return err
// }
// return nil
// })
// }
//
// ```
// <!--End PulumiCodeChooser -->
//
// To create a tcp/tls route you set `sources` and `destinations` by repeating the corresponding element (`source` or `destination`) for each source or destination you want, for example:
//
// <!--Start PulumiCodeChooser -->
// ```go
// package main
//
// import (
//
// "github.com/pulumi/pulumi-kong/sdk/v4/go/kong"
// "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
//
// )
//
// func main() {
// pulumi.Run(func(ctx *pulumi.Context) error {
// _, err := kong.NewRoute(ctx, "route", &kong.RouteArgs{
// Protocols: pulumi.StringArray{
// pulumi.String("tcp"),
// },
// StripPath: pulumi.Bool(true),
// PreserveHost: pulumi.Bool(false),
// Sources: kong.RouteSourceArray{
// &kong.RouteSourceArgs{
// Ip: pulumi.String("192.168.1.1"),
// Port: pulumi.Int(80),
// },
// &kong.RouteSourceArgs{
// Ip: pulumi.String("192.168.1.2"),
// },
// },
// Destinations: kong.RouteDestinationArray{
// &kong.RouteDestinationArgs{
// Ip: pulumi.String("172.10.1.1"),
// Port: pulumi.Int(81),
// },
// },
// Snis: pulumi.StringArray{
// pulumi.String("foo.com"),
// },
// ServiceId: pulumi.Any(kong_service.Service.Id),
// })
// if err != nil {
// return err
// }
// return nil
// })
// }
//
// ```
// <!--End PulumiCodeChooser -->
//
// ## Import
//
// To import a route:
//
// ```sh
// $ pulumi import kong:index/route:Route <route_identifier> <route_id>
// ```
type Route struct {
pulumi.CustomResourceState
// A list of destination `ip` and `port`
Destinations RouteDestinationArrayOutput `pulumi:"destinations"`
// One or more blocks of `name` to set name of header and `values` which is a list of `string` for the header values to match on. See above example of how to set. These headers will cause this Route to match if present in the request. The Host header cannot be used with this attribute: hosts should be specified using the hosts attribute.
Headers RouteHeaderArrayOutput `pulumi:"headers"`
// A list of domain names that match this Route
Hosts pulumi.StringArrayOutput `pulumi:"hosts"`
// The status code Kong responds with when all properties of a Route match except the protocol i.e. if the protocol of the request is HTTP instead of HTTPS. Location header is injected by Kong if the field is set to `301`, `302`, `307` or `308`. Accepted values are: `426`, `301`, `302`, `307`, `308`. Default: `426`.
HttpsRedirectStatusCode pulumi.IntPtrOutput `pulumi:"httpsRedirectStatusCode"`
// A list of HTTP methods that match this Route
Methods pulumi.StringArrayOutput `pulumi:"methods"`
// The name of the route
Name pulumi.StringOutput `pulumi:"name"`
// Controls how the Service path, Route path and requested path are combined when sending a request to the upstream.
PathHandling pulumi.StringPtrOutput `pulumi:"pathHandling"`
// A list of paths that match this Route
Paths pulumi.StringArrayOutput `pulumi:"paths"`
// When matching a Route via one of the hosts domain names, use the request Host header in the upstream request headers. If set to false, the upstream Host header will be that of the Service’s host.
PreserveHost pulumi.BoolPtrOutput `pulumi:"preserveHost"`
// The list of protocols to use
Protocols pulumi.StringArrayOutput `pulumi:"protocols"`
// A number used to choose which route resolves a given request when several routes match it using regexes simultaneously.
RegexPriority pulumi.IntPtrOutput `pulumi:"regexPriority"`
// Whether to enable request body buffering or not. With HTTP 1.1, it may make sense to turn this off on services that receive data with chunked transfer encoding. Default: true.
RequestBuffering pulumi.BoolPtrOutput `pulumi:"requestBuffering"`
// Whether to enable response body buffering or not. With HTTP 1.1, it may make sense to turn this off on services that send data with chunked transfer encoding. Default: true.
ResponseBuffering pulumi.BoolPtrOutput `pulumi:"responseBuffering"`
// Service ID to map to
ServiceId pulumi.StringOutput `pulumi:"serviceId"`
// A list of SNIs that match this Route when using stream routing.
Snis pulumi.StringArrayOutput `pulumi:"snis"`
// A list of source `ip` and `port`
Sources RouteSourceArrayOutput `pulumi:"sources"`
// When matching a Route via one of the paths, strip the matching prefix from the upstream request URL. Default: true.
StripPath pulumi.BoolPtrOutput `pulumi:"stripPath"`
// A list of strings associated with the Route for grouping and filtering.
Tags pulumi.StringArrayOutput `pulumi:"tags"`
}
// NewRoute registers a new resource with the given unique name, arguments, and options.
func NewRoute(ctx *pulumi.Context,
name string, args *RouteArgs, opts ...pulumi.ResourceOption) (*Route, error) {
if args == nil {
return nil, errors.New("missing one or more required arguments")
}
if args.Protocols == nil {
return nil, errors.New("invalid value for required argument 'Protocols'")
}
if args.ServiceId == nil {
return nil, errors.New("invalid value for required argument 'ServiceId'")
}
opts = internal.PkgResourceDefaultOpts(opts)
var resource Route
err := ctx.RegisterResource("kong:index/route:Route", name, args, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// GetRoute gets an existing Route 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 GetRoute(ctx *pulumi.Context,
name string, id pulumi.IDInput, state *RouteState, opts ...pulumi.ResourceOption) (*Route, error) {
var resource Route
err := ctx.ReadResource("kong:index/route:Route", name, id, state, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// Input properties used for looking up and filtering Route resources.
type routeState struct {
// A list of destination `ip` and `port`
Destinations []RouteDestination `pulumi:"destinations"`
// One or more blocks of `name` to set name of header and `values` which is a list of `string` for the header values to match on. See above example of how to set. These headers will cause this Route to match if present in the request. The Host header cannot be used with this attribute: hosts should be specified using the hosts attribute.
Headers []RouteHeader `pulumi:"headers"`
// A list of domain names that match this Route
Hosts []string `pulumi:"hosts"`
// The status code Kong responds with when all properties of a Route match except the protocol i.e. if the protocol of the request is HTTP instead of HTTPS. Location header is injected by Kong if the field is set to `301`, `302`, `307` or `308`. Accepted values are: `426`, `301`, `302`, `307`, `308`. Default: `426`.
HttpsRedirectStatusCode *int `pulumi:"httpsRedirectStatusCode"`
// A list of HTTP methods that match this Route
Methods []string `pulumi:"methods"`
// The name of the route
Name *string `pulumi:"name"`
// Controls how the Service path, Route path and requested path are combined when sending a request to the upstream.
PathHandling *string `pulumi:"pathHandling"`
// A list of paths that match this Route
Paths []string `pulumi:"paths"`
// When matching a Route via one of the hosts domain names, use the request Host header in the upstream request headers. If set to false, the upstream Host header will be that of the Service’s host.
PreserveHost *bool `pulumi:"preserveHost"`
// The list of protocols to use
Protocols []string `pulumi:"protocols"`
// A number used to choose which route resolves a given request when several routes match it using regexes simultaneously.
RegexPriority *int `pulumi:"regexPriority"`
// Whether to enable request body buffering or not. With HTTP 1.1, it may make sense to turn this off on services that receive data with chunked transfer encoding. Default: true.
RequestBuffering *bool `pulumi:"requestBuffering"`
// Whether to enable response body buffering or not. With HTTP 1.1, it may make sense to turn this off on services that send data with chunked transfer encoding. Default: true.
ResponseBuffering *bool `pulumi:"responseBuffering"`
// Service ID to map to
ServiceId *string `pulumi:"serviceId"`
// A list of SNIs that match this Route when using stream routing.
Snis []string `pulumi:"snis"`
// A list of source `ip` and `port`
Sources []RouteSource `pulumi:"sources"`
// When matching a Route via one of the paths, strip the matching prefix from the upstream request URL. Default: true.
StripPath *bool `pulumi:"stripPath"`
// A list of strings associated with the Route for grouping and filtering.
Tags []string `pulumi:"tags"`
}
type RouteState struct {
// A list of destination `ip` and `port`
Destinations RouteDestinationArrayInput
// One or more blocks of `name` to set name of header and `values` which is a list of `string` for the header values to match on. See above example of how to set. These headers will cause this Route to match if present in the request. The Host header cannot be used with this attribute: hosts should be specified using the hosts attribute.
Headers RouteHeaderArrayInput
// A list of domain names that match this Route
Hosts pulumi.StringArrayInput
// The status code Kong responds with when all properties of a Route match except the protocol i.e. if the protocol of the request is HTTP instead of HTTPS. Location header is injected by Kong if the field is set to `301`, `302`, `307` or `308`. Accepted values are: `426`, `301`, `302`, `307`, `308`. Default: `426`.
HttpsRedirectStatusCode pulumi.IntPtrInput
// A list of HTTP methods that match this Route
Methods pulumi.StringArrayInput
// The name of the route
Name pulumi.StringPtrInput
// Controls how the Service path, Route path and requested path are combined when sending a request to the upstream.
PathHandling pulumi.StringPtrInput
// A list of paths that match this Route
Paths pulumi.StringArrayInput
// When matching a Route via one of the hosts domain names, use the request Host header in the upstream request headers. If set to false, the upstream Host header will be that of the Service’s host.
PreserveHost pulumi.BoolPtrInput
// The list of protocols to use
Protocols pulumi.StringArrayInput
// A number used to choose which route resolves a given request when several routes match it using regexes simultaneously.
RegexPriority pulumi.IntPtrInput
// Whether to enable request body buffering or not. With HTTP 1.1, it may make sense to turn this off on services that receive data with chunked transfer encoding. Default: true.
RequestBuffering pulumi.BoolPtrInput
// Whether to enable response body buffering or not. With HTTP 1.1, it may make sense to turn this off on services that send data with chunked transfer encoding. Default: true.
ResponseBuffering pulumi.BoolPtrInput
// Service ID to map to
ServiceId pulumi.StringPtrInput
// A list of SNIs that match this Route when using stream routing.
Snis pulumi.StringArrayInput
// A list of source `ip` and `port`
Sources RouteSourceArrayInput
// When matching a Route via one of the paths, strip the matching prefix from the upstream request URL. Default: true.
StripPath pulumi.BoolPtrInput
// A list of strings associated with the Route for grouping and filtering.
Tags pulumi.StringArrayInput
}
func (RouteState) ElementType() reflect.Type {
return reflect.TypeOf((*routeState)(nil)).Elem()
}
type routeArgs struct {
// A list of destination `ip` and `port`
Destinations []RouteDestination `pulumi:"destinations"`
// One or more blocks of `name` to set name of header and `values` which is a list of `string` for the header values to match on. See above example of how to set. These headers will cause this Route to match if present in the request. The Host header cannot be used with this attribute: hosts should be specified using the hosts attribute.
Headers []RouteHeader `pulumi:"headers"`
// A list of domain names that match this Route
Hosts []string `pulumi:"hosts"`
// The status code Kong responds with when all properties of a Route match except the protocol i.e. if the protocol of the request is HTTP instead of HTTPS. Location header is injected by Kong if the field is set to `301`, `302`, `307` or `308`. Accepted values are: `426`, `301`, `302`, `307`, `308`. Default: `426`.
HttpsRedirectStatusCode *int `pulumi:"httpsRedirectStatusCode"`
// A list of HTTP methods that match this Route
Methods []string `pulumi:"methods"`
// The name of the route
Name *string `pulumi:"name"`
// Controls how the Service path, Route path and requested path are combined when sending a request to the upstream.
PathHandling *string `pulumi:"pathHandling"`
// A list of paths that match this Route
Paths []string `pulumi:"paths"`
// When matching a Route via one of the hosts domain names, use the request Host header in the upstream request headers. If set to false, the upstream Host header will be that of the Service’s host.
PreserveHost *bool `pulumi:"preserveHost"`
// The list of protocols to use
Protocols []string `pulumi:"protocols"`
// A number used to choose which route resolves a given request when several routes match it using regexes simultaneously.
RegexPriority *int `pulumi:"regexPriority"`
// Whether to enable request body buffering or not. With HTTP 1.1, it may make sense to turn this off on services that receive data with chunked transfer encoding. Default: true.
RequestBuffering *bool `pulumi:"requestBuffering"`
// Whether to enable response body buffering or not. With HTTP 1.1, it may make sense to turn this off on services that send data with chunked transfer encoding. Default: true.
ResponseBuffering *bool `pulumi:"responseBuffering"`
// Service ID to map to
ServiceId string `pulumi:"serviceId"`
// A list of SNIs that match this Route when using stream routing.
Snis []string `pulumi:"snis"`
// A list of source `ip` and `port`
Sources []RouteSource `pulumi:"sources"`
// When matching a Route via one of the paths, strip the matching prefix from the upstream request URL. Default: true.
StripPath *bool `pulumi:"stripPath"`
// A list of strings associated with the Route for grouping and filtering.
Tags []string `pulumi:"tags"`
}
// The set of arguments for constructing a Route resource.
type RouteArgs struct {
// A list of destination `ip` and `port`
Destinations RouteDestinationArrayInput
// One or more blocks of `name` to set name of header and `values` which is a list of `string` for the header values to match on. See above example of how to set. These headers will cause this Route to match if present in the request. The Host header cannot be used with this attribute: hosts should be specified using the hosts attribute.
Headers RouteHeaderArrayInput
// A list of domain names that match this Route
Hosts pulumi.StringArrayInput
// The status code Kong responds with when all properties of a Route match except the protocol i.e. if the protocol of the request is HTTP instead of HTTPS. Location header is injected by Kong if the field is set to `301`, `302`, `307` or `308`. Accepted values are: `426`, `301`, `302`, `307`, `308`. Default: `426`.
HttpsRedirectStatusCode pulumi.IntPtrInput
// A list of HTTP methods that match this Route
Methods pulumi.StringArrayInput
// The name of the route
Name pulumi.StringPtrInput
// Controls how the Service path, Route path and requested path are combined when sending a request to the upstream.
PathHandling pulumi.StringPtrInput
// A list of paths that match this Route
Paths pulumi.StringArrayInput
// When matching a Route via one of the hosts domain names, use the request Host header in the upstream request headers. If set to false, the upstream Host header will be that of the Service’s host.
PreserveHost pulumi.BoolPtrInput
// The list of protocols to use
Protocols pulumi.StringArrayInput
// A number used to choose which route resolves a given request when several routes match it using regexes simultaneously.
RegexPriority pulumi.IntPtrInput
// Whether to enable request body buffering or not. With HTTP 1.1, it may make sense to turn this off on services that receive data with chunked transfer encoding. Default: true.
RequestBuffering pulumi.BoolPtrInput
// Whether to enable response body buffering or not. With HTTP 1.1, it may make sense to turn this off on services that send data with chunked transfer encoding. Default: true.
ResponseBuffering pulumi.BoolPtrInput
// Service ID to map to
ServiceId pulumi.StringInput
// A list of SNIs that match this Route when using stream routing.
Snis pulumi.StringArrayInput
// A list of source `ip` and `port`
Sources RouteSourceArrayInput
// When matching a Route via one of the paths, strip the matching prefix from the upstream request URL. Default: true.
StripPath pulumi.BoolPtrInput
// A list of strings associated with the Route for grouping and filtering.
Tags pulumi.StringArrayInput
}
func (RouteArgs) ElementType() reflect.Type {
return reflect.TypeOf((*routeArgs)(nil)).Elem()
}
type RouteInput interface {
pulumi.Input
ToRouteOutput() RouteOutput
ToRouteOutputWithContext(ctx context.Context) RouteOutput
}
func (*Route) ElementType() reflect.Type {
return reflect.TypeOf((**Route)(nil)).Elem()
}
func (i *Route) ToRouteOutput() RouteOutput {
return i.ToRouteOutputWithContext(context.Background())
}
func (i *Route) ToRouteOutputWithContext(ctx context.Context) RouteOutput {
return pulumi.ToOutputWithContext(ctx, i).(RouteOutput)
}
// RouteArrayInput is an input type that accepts RouteArray and RouteArrayOutput values.
// You can construct a concrete instance of `RouteArrayInput` via:
//
// RouteArray{ RouteArgs{...} }
type RouteArrayInput interface {
pulumi.Input
ToRouteArrayOutput() RouteArrayOutput
ToRouteArrayOutputWithContext(context.Context) RouteArrayOutput
}
type RouteArray []RouteInput
func (RouteArray) ElementType() reflect.Type {
return reflect.TypeOf((*[]*Route)(nil)).Elem()
}
func (i RouteArray) ToRouteArrayOutput() RouteArrayOutput {
return i.ToRouteArrayOutputWithContext(context.Background())
}
func (i RouteArray) ToRouteArrayOutputWithContext(ctx context.Context) RouteArrayOutput {
return pulumi.ToOutputWithContext(ctx, i).(RouteArrayOutput)
}
// RouteMapInput is an input type that accepts RouteMap and RouteMapOutput values.
// You can construct a concrete instance of `RouteMapInput` via:
//
// RouteMap{ "key": RouteArgs{...} }
type RouteMapInput interface {
pulumi.Input
ToRouteMapOutput() RouteMapOutput
ToRouteMapOutputWithContext(context.Context) RouteMapOutput
}
type RouteMap map[string]RouteInput
func (RouteMap) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*Route)(nil)).Elem()
}
func (i RouteMap) ToRouteMapOutput() RouteMapOutput {
return i.ToRouteMapOutputWithContext(context.Background())
}
func (i RouteMap) ToRouteMapOutputWithContext(ctx context.Context) RouteMapOutput {
return pulumi.ToOutputWithContext(ctx, i).(RouteMapOutput)
}
type RouteOutput struct{ *pulumi.OutputState }
func (RouteOutput) ElementType() reflect.Type {
return reflect.TypeOf((**Route)(nil)).Elem()
}
func (o RouteOutput) ToRouteOutput() RouteOutput {
return o
}
func (o RouteOutput) ToRouteOutputWithContext(ctx context.Context) RouteOutput {
return o
}
// A list of destination `ip` and `port`
func (o RouteOutput) Destinations() RouteDestinationArrayOutput {
return o.ApplyT(func(v *Route) RouteDestinationArrayOutput { return v.Destinations }).(RouteDestinationArrayOutput)
}
// One or more blocks of `name` to set name of header and `values` which is a list of `string` for the header values to match on. See above example of how to set. These headers will cause this Route to match if present in the request. The Host header cannot be used with this attribute: hosts should be specified using the hosts attribute.
func (o RouteOutput) Headers() RouteHeaderArrayOutput {
return o.ApplyT(func(v *Route) RouteHeaderArrayOutput { return v.Headers }).(RouteHeaderArrayOutput)
}
// A list of domain names that match this Route
func (o RouteOutput) Hosts() pulumi.StringArrayOutput {
return o.ApplyT(func(v *Route) pulumi.StringArrayOutput { return v.Hosts }).(pulumi.StringArrayOutput)
}
// The status code Kong responds with when all properties of a Route match except the protocol i.e. if the protocol of the request is HTTP instead of HTTPS. Location header is injected by Kong if the field is set to `301`, `302`, `307` or `308`. Accepted values are: `426`, `301`, `302`, `307`, `308`. Default: `426`.
func (o RouteOutput) HttpsRedirectStatusCode() pulumi.IntPtrOutput {
return o.ApplyT(func(v *Route) pulumi.IntPtrOutput { return v.HttpsRedirectStatusCode }).(pulumi.IntPtrOutput)
}
// A list of HTTP methods that match this Route
func (o RouteOutput) Methods() pulumi.StringArrayOutput {
return o.ApplyT(func(v *Route) pulumi.StringArrayOutput { return v.Methods }).(pulumi.StringArrayOutput)
}
// The name of the route
func (o RouteOutput) Name() pulumi.StringOutput {
return o.ApplyT(func(v *Route) pulumi.StringOutput { return v.Name }).(pulumi.StringOutput)
}
// Controls how the Service path, Route path and requested path are combined when sending a request to the upstream.
func (o RouteOutput) PathHandling() pulumi.StringPtrOutput {
return o.ApplyT(func(v *Route) pulumi.StringPtrOutput { return v.PathHandling }).(pulumi.StringPtrOutput)
}
// A list of paths that match this Route
func (o RouteOutput) Paths() pulumi.StringArrayOutput {
return o.ApplyT(func(v *Route) pulumi.StringArrayOutput { return v.Paths }).(pulumi.StringArrayOutput)
}
// When matching a Route via one of the hosts domain names, use the request Host header in the upstream request headers. If set to false, the upstream Host header will be that of the Service’s host.
func (o RouteOutput) PreserveHost() pulumi.BoolPtrOutput {
return o.ApplyT(func(v *Route) pulumi.BoolPtrOutput { return v.PreserveHost }).(pulumi.BoolPtrOutput)
}
// The list of protocols to use
func (o RouteOutput) Protocols() pulumi.StringArrayOutput {
return o.ApplyT(func(v *Route) pulumi.StringArrayOutput { return v.Protocols }).(pulumi.StringArrayOutput)
}
// A number used to choose which route resolves a given request when several routes match it using regexes simultaneously.
func (o RouteOutput) RegexPriority() pulumi.IntPtrOutput {
return o.ApplyT(func(v *Route) pulumi.IntPtrOutput { return v.RegexPriority }).(pulumi.IntPtrOutput)
}
// Whether to enable request body buffering or not. With HTTP 1.1, it may make sense to turn this off on services that receive data with chunked transfer encoding. Default: true.
func (o RouteOutput) RequestBuffering() pulumi.BoolPtrOutput {
return o.ApplyT(func(v *Route) pulumi.BoolPtrOutput { return v.RequestBuffering }).(pulumi.BoolPtrOutput)
}
// Whether to enable response body buffering or not. With HTTP 1.1, it may make sense to turn this off on services that send data with chunked transfer encoding. Default: true.
func (o RouteOutput) ResponseBuffering() pulumi.BoolPtrOutput {
return o.ApplyT(func(v *Route) pulumi.BoolPtrOutput { return v.ResponseBuffering }).(pulumi.BoolPtrOutput)
}
// Service ID to map to
func (o RouteOutput) ServiceId() pulumi.StringOutput {
return o.ApplyT(func(v *Route) pulumi.StringOutput { return v.ServiceId }).(pulumi.StringOutput)
}
// A list of SNIs that match this Route when using stream routing.
func (o RouteOutput) Snis() pulumi.StringArrayOutput {
return o.ApplyT(func(v *Route) pulumi.StringArrayOutput { return v.Snis }).(pulumi.StringArrayOutput)
}
// A list of source `ip` and `port`
func (o RouteOutput) Sources() RouteSourceArrayOutput {
return o.ApplyT(func(v *Route) RouteSourceArrayOutput { return v.Sources }).(RouteSourceArrayOutput)
}
// When matching a Route via one of the paths, strip the matching prefix from the upstream request URL. Default: true.
func (o RouteOutput) StripPath() pulumi.BoolPtrOutput {
return o.ApplyT(func(v *Route) pulumi.BoolPtrOutput { return v.StripPath }).(pulumi.BoolPtrOutput)
}
// A list of strings associated with the Route for grouping and filtering.
func (o RouteOutput) Tags() pulumi.StringArrayOutput {
return o.ApplyT(func(v *Route) pulumi.StringArrayOutput { return v.Tags }).(pulumi.StringArrayOutput)
}
type RouteArrayOutput struct{ *pulumi.OutputState }
func (RouteArrayOutput) ElementType() reflect.Type {
return reflect.TypeOf((*[]*Route)(nil)).Elem()
}
func (o RouteArrayOutput) ToRouteArrayOutput() RouteArrayOutput {
return o
}
func (o RouteArrayOutput) ToRouteArrayOutputWithContext(ctx context.Context) RouteArrayOutput {
return o
}
func (o RouteArrayOutput) Index(i pulumi.IntInput) RouteOutput {
return pulumi.All(o, i).ApplyT(func(vs []interface{}) *Route {
return vs[0].([]*Route)[vs[1].(int)]
}).(RouteOutput)
}
type RouteMapOutput struct{ *pulumi.OutputState }
func (RouteMapOutput) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*Route)(nil)).Elem()
}
func (o RouteMapOutput) ToRouteMapOutput() RouteMapOutput {
return o
}
func (o RouteMapOutput) ToRouteMapOutputWithContext(ctx context.Context) RouteMapOutput {
return o
}
func (o RouteMapOutput) MapIndex(k pulumi.StringInput) RouteOutput {
return pulumi.All(o, k).ApplyT(func(vs []interface{}) *Route {
return vs[0].(map[string]*Route)[vs[1].(string)]
}).(RouteOutput)
}
func init() {
pulumi.RegisterInputType(reflect.TypeOf((*RouteInput)(nil)).Elem(), &Route{})
pulumi.RegisterInputType(reflect.TypeOf((*RouteArrayInput)(nil)).Elem(), RouteArray{})
pulumi.RegisterInputType(reflect.TypeOf((*RouteMapInput)(nil)).Elem(), RouteMap{})
pulumi.RegisterOutputType(RouteOutput{})
pulumi.RegisterOutputType(RouteArrayOutput{})
pulumi.RegisterOutputType(RouteMapOutput{})
}