/
policy.go
654 lines (582 loc) · 30.4 KB
/
policy.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
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
// 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 router
import (
"context"
"reflect"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
"github.com/pulumiverse/pulumi-fortios/sdk/go/fortios/internal"
)
// Configure IPv4 routing policies.
//
// ## Example Usage
//
// <!--Start PulumiCodeChooser -->
// ```go
// package main
//
// import (
//
// "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
// "github.com/pulumiverse/pulumi-fortios/sdk/go/fortios/router"
//
// )
//
// func main() {
// pulumi.Run(func(ctx *pulumi.Context) error {
// _, err := router.NewPolicy(ctx, "trname", &router.PolicyArgs{
// Action: pulumi.String("permit"),
// DstNegate: pulumi.String("disable"),
// EndPort: pulumi.Int(25),
// EndSourcePort: pulumi.Int(65535),
// Gateway: pulumi.String("0.0.0.0"),
// InputDevices: router.PolicyInputDeviceArray{
// &router.PolicyInputDeviceArgs{
// Name: pulumi.String("port1"),
// },
// },
// OutputDevice: pulumi.String("port2"),
// Protocol: pulumi.Int(6),
// SeqNum: pulumi.Int(1),
// SrcNegate: pulumi.String("disable"),
// StartPort: pulumi.Int(25),
// StartSourcePort: pulumi.Int(0),
// Status: pulumi.String("enable"),
// Tos: pulumi.String("0x00"),
// TosMask: pulumi.String("0x00"),
// })
// if err != nil {
// return err
// }
// return nil
// })
// }
//
// ```
// <!--End PulumiCodeChooser -->
//
// ## Import
//
// Router Policy can be imported using any of these accepted formats:
//
// ```sh
// $ pulumi import fortios:router/policy:Policy labelname {{seq_num}}
// ```
//
// If you do not want to import arguments of block:
//
// $ export "FORTIOS_IMPORT_TABLE"="false"
//
// ```sh
// $ pulumi import fortios:router/policy:Policy labelname {{seq_num}}
// ```
//
// $ unset "FORTIOS_IMPORT_TABLE"
type Policy struct {
pulumi.CustomResourceState
// Action of the policy route. Valid values: `deny`, `permit`.
Action pulumi.StringOutput `pulumi:"action"`
// Optional comments.
Comments pulumi.StringPtrOutput `pulumi:"comments"`
// Enable/disable negating destination address match. Valid values: `enable`, `disable`.
DstNegate pulumi.StringOutput `pulumi:"dstNegate"`
// Destination address name. The structure of `dstaddr` block is documented below.
Dstaddrs PolicyDstaddrArrayOutput `pulumi:"dstaddrs"`
// Destination IP and mask (x.x.x.x/x). The structure of `dst` block is documented below.
Dsts PolicyDstArrayOutput `pulumi:"dsts"`
// Sort sub-tables, please do not set this parameter when configuring static sub-tables. Options: [ false, true, natural, alphabetical ]. false: Default value, do not sort tables; true/natural: sort tables in natural order. For example: [ a10, a2 ] -> [ a2, a10 ]; alphabetical: sort tables in alphabetical order. For example: [ a10, a2 ] -> [ a10, a2 ].
DynamicSortSubtable pulumi.StringPtrOutput `pulumi:"dynamicSortSubtable"`
// End destination port number (0 - 65535).
EndPort pulumi.IntOutput `pulumi:"endPort"`
// End source port number (0 - 65535).
EndSourcePort pulumi.IntOutput `pulumi:"endSourcePort"`
// IP address of the gateway.
Gateway pulumi.StringOutput `pulumi:"gateway"`
// Get all sub-tables including unconfigured tables. Do not set this variable to true if you configure sub-table in another resource, otherwish conflicts and overwrite will occur. Options: [ false, true ]. false: Default value, do not get unconfigured tables; true: get all tables including unconfigured tables.
GetAllTables pulumi.StringPtrOutput `pulumi:"getAllTables"`
// Enable/disable negation of input device match. Valid values: `enable`, `disable`.
InputDeviceNegate pulumi.StringOutput `pulumi:"inputDeviceNegate"`
// Incoming interface name. The structure of `inputDevice` block is documented below.
InputDevices PolicyInputDeviceArrayOutput `pulumi:"inputDevices"`
// Custom Destination Internet Service name. The structure of `internetServiceCustom` block is documented below.
InternetServiceCustoms PolicyInternetServiceCustomArrayOutput `pulumi:"internetServiceCustoms"`
// Destination Internet Service ID. The structure of `internetServiceId` block is documented below.
InternetServiceIds PolicyInternetServiceIdArrayOutput `pulumi:"internetServiceIds"`
// Outgoing interface name.
OutputDevice pulumi.StringOutput `pulumi:"outputDevice"`
// Protocol number (0 - 255).
Protocol pulumi.IntOutput `pulumi:"protocol"`
// Sequence number.
SeqNum pulumi.IntOutput `pulumi:"seqNum"`
// Enable/disable negating source address match. Valid values: `enable`, `disable`.
SrcNegate pulumi.StringOutput `pulumi:"srcNegate"`
// Source address name. The structure of `srcaddr` block is documented below.
Srcaddrs PolicySrcaddrArrayOutput `pulumi:"srcaddrs"`
// Source IP and mask (x.x.x.x/x). The structure of `src` block is documented below.
Srcs PolicySrcArrayOutput `pulumi:"srcs"`
// Start destination port number (0 - 65535).
StartPort pulumi.IntOutput `pulumi:"startPort"`
// Start source port number (0 - 65535).
StartSourcePort pulumi.IntOutput `pulumi:"startSourcePort"`
// Enable/disable this policy route. Valid values: `enable`, `disable`.
Status pulumi.StringOutput `pulumi:"status"`
// Type of service bit pattern.
Tos pulumi.StringOutput `pulumi:"tos"`
// Type of service evaluated bits.
TosMask pulumi.StringOutput `pulumi:"tosMask"`
// Specifies the vdom to which the resource will be applied when the FortiGate unit is running in VDOM mode. Only one vdom can be specified. If you want to inherit the vdom configuration of the provider, please do not set this parameter.
Vdomparam pulumi.StringPtrOutput `pulumi:"vdomparam"`
}
// NewPolicy registers a new resource with the given unique name, arguments, and options.
func NewPolicy(ctx *pulumi.Context,
name string, args *PolicyArgs, opts ...pulumi.ResourceOption) (*Policy, error) {
if args == nil {
args = &PolicyArgs{}
}
opts = internal.PkgResourceDefaultOpts(opts)
var resource Policy
err := ctx.RegisterResource("fortios:router/policy:Policy", name, args, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// GetPolicy gets an existing Policy 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 GetPolicy(ctx *pulumi.Context,
name string, id pulumi.IDInput, state *PolicyState, opts ...pulumi.ResourceOption) (*Policy, error) {
var resource Policy
err := ctx.ReadResource("fortios:router/policy:Policy", name, id, state, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// Input properties used for looking up and filtering Policy resources.
type policyState struct {
// Action of the policy route. Valid values: `deny`, `permit`.
Action *string `pulumi:"action"`
// Optional comments.
Comments *string `pulumi:"comments"`
// Enable/disable negating destination address match. Valid values: `enable`, `disable`.
DstNegate *string `pulumi:"dstNegate"`
// Destination address name. The structure of `dstaddr` block is documented below.
Dstaddrs []PolicyDstaddr `pulumi:"dstaddrs"`
// Destination IP and mask (x.x.x.x/x). The structure of `dst` block is documented below.
Dsts []PolicyDst `pulumi:"dsts"`
// Sort sub-tables, please do not set this parameter when configuring static sub-tables. Options: [ false, true, natural, alphabetical ]. false: Default value, do not sort tables; true/natural: sort tables in natural order. For example: [ a10, a2 ] -> [ a2, a10 ]; alphabetical: sort tables in alphabetical order. For example: [ a10, a2 ] -> [ a10, a2 ].
DynamicSortSubtable *string `pulumi:"dynamicSortSubtable"`
// End destination port number (0 - 65535).
EndPort *int `pulumi:"endPort"`
// End source port number (0 - 65535).
EndSourcePort *int `pulumi:"endSourcePort"`
// IP address of the gateway.
Gateway *string `pulumi:"gateway"`
// Get all sub-tables including unconfigured tables. Do not set this variable to true if you configure sub-table in another resource, otherwish conflicts and overwrite will occur. Options: [ false, true ]. false: Default value, do not get unconfigured tables; true: get all tables including unconfigured tables.
GetAllTables *string `pulumi:"getAllTables"`
// Enable/disable negation of input device match. Valid values: `enable`, `disable`.
InputDeviceNegate *string `pulumi:"inputDeviceNegate"`
// Incoming interface name. The structure of `inputDevice` block is documented below.
InputDevices []PolicyInputDevice `pulumi:"inputDevices"`
// Custom Destination Internet Service name. The structure of `internetServiceCustom` block is documented below.
InternetServiceCustoms []PolicyInternetServiceCustom `pulumi:"internetServiceCustoms"`
// Destination Internet Service ID. The structure of `internetServiceId` block is documented below.
InternetServiceIds []PolicyInternetServiceId `pulumi:"internetServiceIds"`
// Outgoing interface name.
OutputDevice *string `pulumi:"outputDevice"`
// Protocol number (0 - 255).
Protocol *int `pulumi:"protocol"`
// Sequence number.
SeqNum *int `pulumi:"seqNum"`
// Enable/disable negating source address match. Valid values: `enable`, `disable`.
SrcNegate *string `pulumi:"srcNegate"`
// Source address name. The structure of `srcaddr` block is documented below.
Srcaddrs []PolicySrcaddr `pulumi:"srcaddrs"`
// Source IP and mask (x.x.x.x/x). The structure of `src` block is documented below.
Srcs []PolicySrc `pulumi:"srcs"`
// Start destination port number (0 - 65535).
StartPort *int `pulumi:"startPort"`
// Start source port number (0 - 65535).
StartSourcePort *int `pulumi:"startSourcePort"`
// Enable/disable this policy route. Valid values: `enable`, `disable`.
Status *string `pulumi:"status"`
// Type of service bit pattern.
Tos *string `pulumi:"tos"`
// Type of service evaluated bits.
TosMask *string `pulumi:"tosMask"`
// Specifies the vdom to which the resource will be applied when the FortiGate unit is running in VDOM mode. Only one vdom can be specified. If you want to inherit the vdom configuration of the provider, please do not set this parameter.
Vdomparam *string `pulumi:"vdomparam"`
}
type PolicyState struct {
// Action of the policy route. Valid values: `deny`, `permit`.
Action pulumi.StringPtrInput
// Optional comments.
Comments pulumi.StringPtrInput
// Enable/disable negating destination address match. Valid values: `enable`, `disable`.
DstNegate pulumi.StringPtrInput
// Destination address name. The structure of `dstaddr` block is documented below.
Dstaddrs PolicyDstaddrArrayInput
// Destination IP and mask (x.x.x.x/x). The structure of `dst` block is documented below.
Dsts PolicyDstArrayInput
// Sort sub-tables, please do not set this parameter when configuring static sub-tables. Options: [ false, true, natural, alphabetical ]. false: Default value, do not sort tables; true/natural: sort tables in natural order. For example: [ a10, a2 ] -> [ a2, a10 ]; alphabetical: sort tables in alphabetical order. For example: [ a10, a2 ] -> [ a10, a2 ].
DynamicSortSubtable pulumi.StringPtrInput
// End destination port number (0 - 65535).
EndPort pulumi.IntPtrInput
// End source port number (0 - 65535).
EndSourcePort pulumi.IntPtrInput
// IP address of the gateway.
Gateway pulumi.StringPtrInput
// Get all sub-tables including unconfigured tables. Do not set this variable to true if you configure sub-table in another resource, otherwish conflicts and overwrite will occur. Options: [ false, true ]. false: Default value, do not get unconfigured tables; true: get all tables including unconfigured tables.
GetAllTables pulumi.StringPtrInput
// Enable/disable negation of input device match. Valid values: `enable`, `disable`.
InputDeviceNegate pulumi.StringPtrInput
// Incoming interface name. The structure of `inputDevice` block is documented below.
InputDevices PolicyInputDeviceArrayInput
// Custom Destination Internet Service name. The structure of `internetServiceCustom` block is documented below.
InternetServiceCustoms PolicyInternetServiceCustomArrayInput
// Destination Internet Service ID. The structure of `internetServiceId` block is documented below.
InternetServiceIds PolicyInternetServiceIdArrayInput
// Outgoing interface name.
OutputDevice pulumi.StringPtrInput
// Protocol number (0 - 255).
Protocol pulumi.IntPtrInput
// Sequence number.
SeqNum pulumi.IntPtrInput
// Enable/disable negating source address match. Valid values: `enable`, `disable`.
SrcNegate pulumi.StringPtrInput
// Source address name. The structure of `srcaddr` block is documented below.
Srcaddrs PolicySrcaddrArrayInput
// Source IP and mask (x.x.x.x/x). The structure of `src` block is documented below.
Srcs PolicySrcArrayInput
// Start destination port number (0 - 65535).
StartPort pulumi.IntPtrInput
// Start source port number (0 - 65535).
StartSourcePort pulumi.IntPtrInput
// Enable/disable this policy route. Valid values: `enable`, `disable`.
Status pulumi.StringPtrInput
// Type of service bit pattern.
Tos pulumi.StringPtrInput
// Type of service evaluated bits.
TosMask pulumi.StringPtrInput
// Specifies the vdom to which the resource will be applied when the FortiGate unit is running in VDOM mode. Only one vdom can be specified. If you want to inherit the vdom configuration of the provider, please do not set this parameter.
Vdomparam pulumi.StringPtrInput
}
func (PolicyState) ElementType() reflect.Type {
return reflect.TypeOf((*policyState)(nil)).Elem()
}
type policyArgs struct {
// Action of the policy route. Valid values: `deny`, `permit`.
Action *string `pulumi:"action"`
// Optional comments.
Comments *string `pulumi:"comments"`
// Enable/disable negating destination address match. Valid values: `enable`, `disable`.
DstNegate *string `pulumi:"dstNegate"`
// Destination address name. The structure of `dstaddr` block is documented below.
Dstaddrs []PolicyDstaddr `pulumi:"dstaddrs"`
// Destination IP and mask (x.x.x.x/x). The structure of `dst` block is documented below.
Dsts []PolicyDst `pulumi:"dsts"`
// Sort sub-tables, please do not set this parameter when configuring static sub-tables. Options: [ false, true, natural, alphabetical ]. false: Default value, do not sort tables; true/natural: sort tables in natural order. For example: [ a10, a2 ] -> [ a2, a10 ]; alphabetical: sort tables in alphabetical order. For example: [ a10, a2 ] -> [ a10, a2 ].
DynamicSortSubtable *string `pulumi:"dynamicSortSubtable"`
// End destination port number (0 - 65535).
EndPort *int `pulumi:"endPort"`
// End source port number (0 - 65535).
EndSourcePort *int `pulumi:"endSourcePort"`
// IP address of the gateway.
Gateway *string `pulumi:"gateway"`
// Get all sub-tables including unconfigured tables. Do not set this variable to true if you configure sub-table in another resource, otherwish conflicts and overwrite will occur. Options: [ false, true ]. false: Default value, do not get unconfigured tables; true: get all tables including unconfigured tables.
GetAllTables *string `pulumi:"getAllTables"`
// Enable/disable negation of input device match. Valid values: `enable`, `disable`.
InputDeviceNegate *string `pulumi:"inputDeviceNegate"`
// Incoming interface name. The structure of `inputDevice` block is documented below.
InputDevices []PolicyInputDevice `pulumi:"inputDevices"`
// Custom Destination Internet Service name. The structure of `internetServiceCustom` block is documented below.
InternetServiceCustoms []PolicyInternetServiceCustom `pulumi:"internetServiceCustoms"`
// Destination Internet Service ID. The structure of `internetServiceId` block is documented below.
InternetServiceIds []PolicyInternetServiceId `pulumi:"internetServiceIds"`
// Outgoing interface name.
OutputDevice *string `pulumi:"outputDevice"`
// Protocol number (0 - 255).
Protocol *int `pulumi:"protocol"`
// Sequence number.
SeqNum *int `pulumi:"seqNum"`
// Enable/disable negating source address match. Valid values: `enable`, `disable`.
SrcNegate *string `pulumi:"srcNegate"`
// Source address name. The structure of `srcaddr` block is documented below.
Srcaddrs []PolicySrcaddr `pulumi:"srcaddrs"`
// Source IP and mask (x.x.x.x/x). The structure of `src` block is documented below.
Srcs []PolicySrc `pulumi:"srcs"`
// Start destination port number (0 - 65535).
StartPort *int `pulumi:"startPort"`
// Start source port number (0 - 65535).
StartSourcePort *int `pulumi:"startSourcePort"`
// Enable/disable this policy route. Valid values: `enable`, `disable`.
Status *string `pulumi:"status"`
// Type of service bit pattern.
Tos *string `pulumi:"tos"`
// Type of service evaluated bits.
TosMask *string `pulumi:"tosMask"`
// Specifies the vdom to which the resource will be applied when the FortiGate unit is running in VDOM mode. Only one vdom can be specified. If you want to inherit the vdom configuration of the provider, please do not set this parameter.
Vdomparam *string `pulumi:"vdomparam"`
}
// The set of arguments for constructing a Policy resource.
type PolicyArgs struct {
// Action of the policy route. Valid values: `deny`, `permit`.
Action pulumi.StringPtrInput
// Optional comments.
Comments pulumi.StringPtrInput
// Enable/disable negating destination address match. Valid values: `enable`, `disable`.
DstNegate pulumi.StringPtrInput
// Destination address name. The structure of `dstaddr` block is documented below.
Dstaddrs PolicyDstaddrArrayInput
// Destination IP and mask (x.x.x.x/x). The structure of `dst` block is documented below.
Dsts PolicyDstArrayInput
// Sort sub-tables, please do not set this parameter when configuring static sub-tables. Options: [ false, true, natural, alphabetical ]. false: Default value, do not sort tables; true/natural: sort tables in natural order. For example: [ a10, a2 ] -> [ a2, a10 ]; alphabetical: sort tables in alphabetical order. For example: [ a10, a2 ] -> [ a10, a2 ].
DynamicSortSubtable pulumi.StringPtrInput
// End destination port number (0 - 65535).
EndPort pulumi.IntPtrInput
// End source port number (0 - 65535).
EndSourcePort pulumi.IntPtrInput
// IP address of the gateway.
Gateway pulumi.StringPtrInput
// Get all sub-tables including unconfigured tables. Do not set this variable to true if you configure sub-table in another resource, otherwish conflicts and overwrite will occur. Options: [ false, true ]. false: Default value, do not get unconfigured tables; true: get all tables including unconfigured tables.
GetAllTables pulumi.StringPtrInput
// Enable/disable negation of input device match. Valid values: `enable`, `disable`.
InputDeviceNegate pulumi.StringPtrInput
// Incoming interface name. The structure of `inputDevice` block is documented below.
InputDevices PolicyInputDeviceArrayInput
// Custom Destination Internet Service name. The structure of `internetServiceCustom` block is documented below.
InternetServiceCustoms PolicyInternetServiceCustomArrayInput
// Destination Internet Service ID. The structure of `internetServiceId` block is documented below.
InternetServiceIds PolicyInternetServiceIdArrayInput
// Outgoing interface name.
OutputDevice pulumi.StringPtrInput
// Protocol number (0 - 255).
Protocol pulumi.IntPtrInput
// Sequence number.
SeqNum pulumi.IntPtrInput
// Enable/disable negating source address match. Valid values: `enable`, `disable`.
SrcNegate pulumi.StringPtrInput
// Source address name. The structure of `srcaddr` block is documented below.
Srcaddrs PolicySrcaddrArrayInput
// Source IP and mask (x.x.x.x/x). The structure of `src` block is documented below.
Srcs PolicySrcArrayInput
// Start destination port number (0 - 65535).
StartPort pulumi.IntPtrInput
// Start source port number (0 - 65535).
StartSourcePort pulumi.IntPtrInput
// Enable/disable this policy route. Valid values: `enable`, `disable`.
Status pulumi.StringPtrInput
// Type of service bit pattern.
Tos pulumi.StringPtrInput
// Type of service evaluated bits.
TosMask pulumi.StringPtrInput
// Specifies the vdom to which the resource will be applied when the FortiGate unit is running in VDOM mode. Only one vdom can be specified. If you want to inherit the vdom configuration of the provider, please do not set this parameter.
Vdomparam pulumi.StringPtrInput
}
func (PolicyArgs) ElementType() reflect.Type {
return reflect.TypeOf((*policyArgs)(nil)).Elem()
}
type PolicyInput interface {
pulumi.Input
ToPolicyOutput() PolicyOutput
ToPolicyOutputWithContext(ctx context.Context) PolicyOutput
}
func (*Policy) ElementType() reflect.Type {
return reflect.TypeOf((**Policy)(nil)).Elem()
}
func (i *Policy) ToPolicyOutput() PolicyOutput {
return i.ToPolicyOutputWithContext(context.Background())
}
func (i *Policy) ToPolicyOutputWithContext(ctx context.Context) PolicyOutput {
return pulumi.ToOutputWithContext(ctx, i).(PolicyOutput)
}
// PolicyArrayInput is an input type that accepts PolicyArray and PolicyArrayOutput values.
// You can construct a concrete instance of `PolicyArrayInput` via:
//
// PolicyArray{ PolicyArgs{...} }
type PolicyArrayInput interface {
pulumi.Input
ToPolicyArrayOutput() PolicyArrayOutput
ToPolicyArrayOutputWithContext(context.Context) PolicyArrayOutput
}
type PolicyArray []PolicyInput
func (PolicyArray) ElementType() reflect.Type {
return reflect.TypeOf((*[]*Policy)(nil)).Elem()
}
func (i PolicyArray) ToPolicyArrayOutput() PolicyArrayOutput {
return i.ToPolicyArrayOutputWithContext(context.Background())
}
func (i PolicyArray) ToPolicyArrayOutputWithContext(ctx context.Context) PolicyArrayOutput {
return pulumi.ToOutputWithContext(ctx, i).(PolicyArrayOutput)
}
// PolicyMapInput is an input type that accepts PolicyMap and PolicyMapOutput values.
// You can construct a concrete instance of `PolicyMapInput` via:
//
// PolicyMap{ "key": PolicyArgs{...} }
type PolicyMapInput interface {
pulumi.Input
ToPolicyMapOutput() PolicyMapOutput
ToPolicyMapOutputWithContext(context.Context) PolicyMapOutput
}
type PolicyMap map[string]PolicyInput
func (PolicyMap) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*Policy)(nil)).Elem()
}
func (i PolicyMap) ToPolicyMapOutput() PolicyMapOutput {
return i.ToPolicyMapOutputWithContext(context.Background())
}
func (i PolicyMap) ToPolicyMapOutputWithContext(ctx context.Context) PolicyMapOutput {
return pulumi.ToOutputWithContext(ctx, i).(PolicyMapOutput)
}
type PolicyOutput struct{ *pulumi.OutputState }
func (PolicyOutput) ElementType() reflect.Type {
return reflect.TypeOf((**Policy)(nil)).Elem()
}
func (o PolicyOutput) ToPolicyOutput() PolicyOutput {
return o
}
func (o PolicyOutput) ToPolicyOutputWithContext(ctx context.Context) PolicyOutput {
return o
}
// Action of the policy route. Valid values: `deny`, `permit`.
func (o PolicyOutput) Action() pulumi.StringOutput {
return o.ApplyT(func(v *Policy) pulumi.StringOutput { return v.Action }).(pulumi.StringOutput)
}
// Optional comments.
func (o PolicyOutput) Comments() pulumi.StringPtrOutput {
return o.ApplyT(func(v *Policy) pulumi.StringPtrOutput { return v.Comments }).(pulumi.StringPtrOutput)
}
// Enable/disable negating destination address match. Valid values: `enable`, `disable`.
func (o PolicyOutput) DstNegate() pulumi.StringOutput {
return o.ApplyT(func(v *Policy) pulumi.StringOutput { return v.DstNegate }).(pulumi.StringOutput)
}
// Destination address name. The structure of `dstaddr` block is documented below.
func (o PolicyOutput) Dstaddrs() PolicyDstaddrArrayOutput {
return o.ApplyT(func(v *Policy) PolicyDstaddrArrayOutput { return v.Dstaddrs }).(PolicyDstaddrArrayOutput)
}
// Destination IP and mask (x.x.x.x/x). The structure of `dst` block is documented below.
func (o PolicyOutput) Dsts() PolicyDstArrayOutput {
return o.ApplyT(func(v *Policy) PolicyDstArrayOutput { return v.Dsts }).(PolicyDstArrayOutput)
}
// Sort sub-tables, please do not set this parameter when configuring static sub-tables. Options: [ false, true, natural, alphabetical ]. false: Default value, do not sort tables; true/natural: sort tables in natural order. For example: [ a10, a2 ] -> [ a2, a10 ]; alphabetical: sort tables in alphabetical order. For example: [ a10, a2 ] -> [ a10, a2 ].
func (o PolicyOutput) DynamicSortSubtable() pulumi.StringPtrOutput {
return o.ApplyT(func(v *Policy) pulumi.StringPtrOutput { return v.DynamicSortSubtable }).(pulumi.StringPtrOutput)
}
// End destination port number (0 - 65535).
func (o PolicyOutput) EndPort() pulumi.IntOutput {
return o.ApplyT(func(v *Policy) pulumi.IntOutput { return v.EndPort }).(pulumi.IntOutput)
}
// End source port number (0 - 65535).
func (o PolicyOutput) EndSourcePort() pulumi.IntOutput {
return o.ApplyT(func(v *Policy) pulumi.IntOutput { return v.EndSourcePort }).(pulumi.IntOutput)
}
// IP address of the gateway.
func (o PolicyOutput) Gateway() pulumi.StringOutput {
return o.ApplyT(func(v *Policy) pulumi.StringOutput { return v.Gateway }).(pulumi.StringOutput)
}
// Get all sub-tables including unconfigured tables. Do not set this variable to true if you configure sub-table in another resource, otherwish conflicts and overwrite will occur. Options: [ false, true ]. false: Default value, do not get unconfigured tables; true: get all tables including unconfigured tables.
func (o PolicyOutput) GetAllTables() pulumi.StringPtrOutput {
return o.ApplyT(func(v *Policy) pulumi.StringPtrOutput { return v.GetAllTables }).(pulumi.StringPtrOutput)
}
// Enable/disable negation of input device match. Valid values: `enable`, `disable`.
func (o PolicyOutput) InputDeviceNegate() pulumi.StringOutput {
return o.ApplyT(func(v *Policy) pulumi.StringOutput { return v.InputDeviceNegate }).(pulumi.StringOutput)
}
// Incoming interface name. The structure of `inputDevice` block is documented below.
func (o PolicyOutput) InputDevices() PolicyInputDeviceArrayOutput {
return o.ApplyT(func(v *Policy) PolicyInputDeviceArrayOutput { return v.InputDevices }).(PolicyInputDeviceArrayOutput)
}
// Custom Destination Internet Service name. The structure of `internetServiceCustom` block is documented below.
func (o PolicyOutput) InternetServiceCustoms() PolicyInternetServiceCustomArrayOutput {
return o.ApplyT(func(v *Policy) PolicyInternetServiceCustomArrayOutput { return v.InternetServiceCustoms }).(PolicyInternetServiceCustomArrayOutput)
}
// Destination Internet Service ID. The structure of `internetServiceId` block is documented below.
func (o PolicyOutput) InternetServiceIds() PolicyInternetServiceIdArrayOutput {
return o.ApplyT(func(v *Policy) PolicyInternetServiceIdArrayOutput { return v.InternetServiceIds }).(PolicyInternetServiceIdArrayOutput)
}
// Outgoing interface name.
func (o PolicyOutput) OutputDevice() pulumi.StringOutput {
return o.ApplyT(func(v *Policy) pulumi.StringOutput { return v.OutputDevice }).(pulumi.StringOutput)
}
// Protocol number (0 - 255).
func (o PolicyOutput) Protocol() pulumi.IntOutput {
return o.ApplyT(func(v *Policy) pulumi.IntOutput { return v.Protocol }).(pulumi.IntOutput)
}
// Sequence number.
func (o PolicyOutput) SeqNum() pulumi.IntOutput {
return o.ApplyT(func(v *Policy) pulumi.IntOutput { return v.SeqNum }).(pulumi.IntOutput)
}
// Enable/disable negating source address match. Valid values: `enable`, `disable`.
func (o PolicyOutput) SrcNegate() pulumi.StringOutput {
return o.ApplyT(func(v *Policy) pulumi.StringOutput { return v.SrcNegate }).(pulumi.StringOutput)
}
// Source address name. The structure of `srcaddr` block is documented below.
func (o PolicyOutput) Srcaddrs() PolicySrcaddrArrayOutput {
return o.ApplyT(func(v *Policy) PolicySrcaddrArrayOutput { return v.Srcaddrs }).(PolicySrcaddrArrayOutput)
}
// Source IP and mask (x.x.x.x/x). The structure of `src` block is documented below.
func (o PolicyOutput) Srcs() PolicySrcArrayOutput {
return o.ApplyT(func(v *Policy) PolicySrcArrayOutput { return v.Srcs }).(PolicySrcArrayOutput)
}
// Start destination port number (0 - 65535).
func (o PolicyOutput) StartPort() pulumi.IntOutput {
return o.ApplyT(func(v *Policy) pulumi.IntOutput { return v.StartPort }).(pulumi.IntOutput)
}
// Start source port number (0 - 65535).
func (o PolicyOutput) StartSourcePort() pulumi.IntOutput {
return o.ApplyT(func(v *Policy) pulumi.IntOutput { return v.StartSourcePort }).(pulumi.IntOutput)
}
// Enable/disable this policy route. Valid values: `enable`, `disable`.
func (o PolicyOutput) Status() pulumi.StringOutput {
return o.ApplyT(func(v *Policy) pulumi.StringOutput { return v.Status }).(pulumi.StringOutput)
}
// Type of service bit pattern.
func (o PolicyOutput) Tos() pulumi.StringOutput {
return o.ApplyT(func(v *Policy) pulumi.StringOutput { return v.Tos }).(pulumi.StringOutput)
}
// Type of service evaluated bits.
func (o PolicyOutput) TosMask() pulumi.StringOutput {
return o.ApplyT(func(v *Policy) pulumi.StringOutput { return v.TosMask }).(pulumi.StringOutput)
}
// Specifies the vdom to which the resource will be applied when the FortiGate unit is running in VDOM mode. Only one vdom can be specified. If you want to inherit the vdom configuration of the provider, please do not set this parameter.
func (o PolicyOutput) Vdomparam() pulumi.StringPtrOutput {
return o.ApplyT(func(v *Policy) pulumi.StringPtrOutput { return v.Vdomparam }).(pulumi.StringPtrOutput)
}
type PolicyArrayOutput struct{ *pulumi.OutputState }
func (PolicyArrayOutput) ElementType() reflect.Type {
return reflect.TypeOf((*[]*Policy)(nil)).Elem()
}
func (o PolicyArrayOutput) ToPolicyArrayOutput() PolicyArrayOutput {
return o
}
func (o PolicyArrayOutput) ToPolicyArrayOutputWithContext(ctx context.Context) PolicyArrayOutput {
return o
}
func (o PolicyArrayOutput) Index(i pulumi.IntInput) PolicyOutput {
return pulumi.All(o, i).ApplyT(func(vs []interface{}) *Policy {
return vs[0].([]*Policy)[vs[1].(int)]
}).(PolicyOutput)
}
type PolicyMapOutput struct{ *pulumi.OutputState }
func (PolicyMapOutput) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*Policy)(nil)).Elem()
}
func (o PolicyMapOutput) ToPolicyMapOutput() PolicyMapOutput {
return o
}
func (o PolicyMapOutput) ToPolicyMapOutputWithContext(ctx context.Context) PolicyMapOutput {
return o
}
func (o PolicyMapOutput) MapIndex(k pulumi.StringInput) PolicyOutput {
return pulumi.All(o, k).ApplyT(func(vs []interface{}) *Policy {
return vs[0].(map[string]*Policy)[vs[1].(string)]
}).(PolicyOutput)
}
func init() {
pulumi.RegisterInputType(reflect.TypeOf((*PolicyInput)(nil)).Elem(), &Policy{})
pulumi.RegisterInputType(reflect.TypeOf((*PolicyArrayInput)(nil)).Elem(), PolicyArray{})
pulumi.RegisterInputType(reflect.TypeOf((*PolicyMapInput)(nil)).Elem(), PolicyMap{})
pulumi.RegisterOutputType(PolicyOutput{})
pulumi.RegisterOutputType(PolicyArrayOutput{})
pulumi.RegisterOutputType(PolicyMapOutput{})
}