/
override.go
447 lines (389 loc) · 17 KB
/
override.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
// 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 web
import (
"context"
"reflect"
"errors"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
"github.com/pulumiverse/pulumi-fortios/sdk/go/fortios/internal"
)
// Configure FortiGuard Web Filter administrative overrides.
//
// ## Example Usage
//
// <!--Start PulumiCodeChooser -->
// ```go
// package main
//
// import (
//
// "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
// "github.com/pulumiverse/pulumi-fortios/sdk/go/fortios/filter"
//
// )
//
// func main() {
// pulumi.Run(func(ctx *pulumi.Context) error {
// _, err := filter.NewOverride(ctx, "trname", &filter.OverrideArgs{
// Expires: pulumi.String("2021/03/16 19:18:25"),
// Fosid: pulumi.Int(1),
// Ip: pulumi.String("69.101.119.0"),
// Ip6: pulumi.String("4565:7700::"),
// NewProfile: pulumi.String("monitor-all"),
// OldProfile: pulumi.String("default"),
// Scope: pulumi.String("user"),
// Status: pulumi.String("disable"),
// User: pulumi.String("Eew"),
// })
// if err != nil {
// return err
// }
// return nil
// })
// }
//
// ```
// <!--End PulumiCodeChooser -->
//
// ## Import
//
// Webfilter Override can be imported using any of these accepted formats:
//
// ```sh
// $ pulumi import fortios:filter/web/override:Override labelname {{fosid}}
// ```
//
// If you do not want to import arguments of block:
//
// $ export "FORTIOS_IMPORT_TABLE"="false"
//
// ```sh
// $ pulumi import fortios:filter/web/override:Override labelname {{fosid}}
// ```
//
// $ unset "FORTIOS_IMPORT_TABLE"
type Override struct {
pulumi.CustomResourceState
// Override expiration date and time, from 5 minutes to 365 from now (format: yyyy/mm/dd hh:mm:ss).
Expires pulumi.StringOutput `pulumi:"expires"`
// Override rule ID.
Fosid pulumi.IntOutput `pulumi:"fosid"`
// Initiating user of override (read-only setting).
Initiator pulumi.StringOutput `pulumi:"initiator"`
// IPv4 address which the override applies.
Ip pulumi.StringOutput `pulumi:"ip"`
// IPv6 address which the override applies.
Ip6 pulumi.StringOutput `pulumi:"ip6"`
// Name of the new web filter profile used by the override.
NewProfile pulumi.StringOutput `pulumi:"newProfile"`
// Name of the web filter profile which the override applies.
OldProfile pulumi.StringOutput `pulumi:"oldProfile"`
// Override either the specific user, user group, IPv4 address, or IPv6 address. Valid values: `user`, `user-group`, `ip`, `ip6`.
Scope pulumi.StringOutput `pulumi:"scope"`
// Enable/disable override rule. Valid values: `enable`, `disable`.
Status pulumi.StringOutput `pulumi:"status"`
// Name of the user which the override applies.
User pulumi.StringOutput `pulumi:"user"`
// Specify the user group for which the override applies.
UserGroup pulumi.StringOutput `pulumi:"userGroup"`
// 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"`
}
// NewOverride registers a new resource with the given unique name, arguments, and options.
func NewOverride(ctx *pulumi.Context,
name string, args *OverrideArgs, opts ...pulumi.ResourceOption) (*Override, error) {
if args == nil {
return nil, errors.New("missing one or more required arguments")
}
if args.Expires == nil {
return nil, errors.New("invalid value for required argument 'Expires'")
}
if args.NewProfile == nil {
return nil, errors.New("invalid value for required argument 'NewProfile'")
}
if args.OldProfile == nil {
return nil, errors.New("invalid value for required argument 'OldProfile'")
}
if args.User == nil {
return nil, errors.New("invalid value for required argument 'User'")
}
opts = internal.PkgResourceDefaultOpts(opts)
var resource Override
err := ctx.RegisterResource("fortios:filter/web/override:Override", name, args, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// GetOverride gets an existing Override 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 GetOverride(ctx *pulumi.Context,
name string, id pulumi.IDInput, state *OverrideState, opts ...pulumi.ResourceOption) (*Override, error) {
var resource Override
err := ctx.ReadResource("fortios:filter/web/override:Override", name, id, state, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// Input properties used for looking up and filtering Override resources.
type overrideState struct {
// Override expiration date and time, from 5 minutes to 365 from now (format: yyyy/mm/dd hh:mm:ss).
Expires *string `pulumi:"expires"`
// Override rule ID.
Fosid *int `pulumi:"fosid"`
// Initiating user of override (read-only setting).
Initiator *string `pulumi:"initiator"`
// IPv4 address which the override applies.
Ip *string `pulumi:"ip"`
// IPv6 address which the override applies.
Ip6 *string `pulumi:"ip6"`
// Name of the new web filter profile used by the override.
NewProfile *string `pulumi:"newProfile"`
// Name of the web filter profile which the override applies.
OldProfile *string `pulumi:"oldProfile"`
// Override either the specific user, user group, IPv4 address, or IPv6 address. Valid values: `user`, `user-group`, `ip`, `ip6`.
Scope *string `pulumi:"scope"`
// Enable/disable override rule. Valid values: `enable`, `disable`.
Status *string `pulumi:"status"`
// Name of the user which the override applies.
User *string `pulumi:"user"`
// Specify the user group for which the override applies.
UserGroup *string `pulumi:"userGroup"`
// 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 OverrideState struct {
// Override expiration date and time, from 5 minutes to 365 from now (format: yyyy/mm/dd hh:mm:ss).
Expires pulumi.StringPtrInput
// Override rule ID.
Fosid pulumi.IntPtrInput
// Initiating user of override (read-only setting).
Initiator pulumi.StringPtrInput
// IPv4 address which the override applies.
Ip pulumi.StringPtrInput
// IPv6 address which the override applies.
Ip6 pulumi.StringPtrInput
// Name of the new web filter profile used by the override.
NewProfile pulumi.StringPtrInput
// Name of the web filter profile which the override applies.
OldProfile pulumi.StringPtrInput
// Override either the specific user, user group, IPv4 address, or IPv6 address. Valid values: `user`, `user-group`, `ip`, `ip6`.
Scope pulumi.StringPtrInput
// Enable/disable override rule. Valid values: `enable`, `disable`.
Status pulumi.StringPtrInput
// Name of the user which the override applies.
User pulumi.StringPtrInput
// Specify the user group for which the override applies.
UserGroup 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 (OverrideState) ElementType() reflect.Type {
return reflect.TypeOf((*overrideState)(nil)).Elem()
}
type overrideArgs struct {
// Override expiration date and time, from 5 minutes to 365 from now (format: yyyy/mm/dd hh:mm:ss).
Expires string `pulumi:"expires"`
// Override rule ID.
Fosid *int `pulumi:"fosid"`
// Initiating user of override (read-only setting).
Initiator *string `pulumi:"initiator"`
// IPv4 address which the override applies.
Ip *string `pulumi:"ip"`
// IPv6 address which the override applies.
Ip6 *string `pulumi:"ip6"`
// Name of the new web filter profile used by the override.
NewProfile string `pulumi:"newProfile"`
// Name of the web filter profile which the override applies.
OldProfile string `pulumi:"oldProfile"`
// Override either the specific user, user group, IPv4 address, or IPv6 address. Valid values: `user`, `user-group`, `ip`, `ip6`.
Scope *string `pulumi:"scope"`
// Enable/disable override rule. Valid values: `enable`, `disable`.
Status *string `pulumi:"status"`
// Name of the user which the override applies.
User string `pulumi:"user"`
// Specify the user group for which the override applies.
UserGroup *string `pulumi:"userGroup"`
// 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 Override resource.
type OverrideArgs struct {
// Override expiration date and time, from 5 minutes to 365 from now (format: yyyy/mm/dd hh:mm:ss).
Expires pulumi.StringInput
// Override rule ID.
Fosid pulumi.IntPtrInput
// Initiating user of override (read-only setting).
Initiator pulumi.StringPtrInput
// IPv4 address which the override applies.
Ip pulumi.StringPtrInput
// IPv6 address which the override applies.
Ip6 pulumi.StringPtrInput
// Name of the new web filter profile used by the override.
NewProfile pulumi.StringInput
// Name of the web filter profile which the override applies.
OldProfile pulumi.StringInput
// Override either the specific user, user group, IPv4 address, or IPv6 address. Valid values: `user`, `user-group`, `ip`, `ip6`.
Scope pulumi.StringPtrInput
// Enable/disable override rule. Valid values: `enable`, `disable`.
Status pulumi.StringPtrInput
// Name of the user which the override applies.
User pulumi.StringInput
// Specify the user group for which the override applies.
UserGroup 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 (OverrideArgs) ElementType() reflect.Type {
return reflect.TypeOf((*overrideArgs)(nil)).Elem()
}
type OverrideInput interface {
pulumi.Input
ToOverrideOutput() OverrideOutput
ToOverrideOutputWithContext(ctx context.Context) OverrideOutput
}
func (*Override) ElementType() reflect.Type {
return reflect.TypeOf((**Override)(nil)).Elem()
}
func (i *Override) ToOverrideOutput() OverrideOutput {
return i.ToOverrideOutputWithContext(context.Background())
}
func (i *Override) ToOverrideOutputWithContext(ctx context.Context) OverrideOutput {
return pulumi.ToOutputWithContext(ctx, i).(OverrideOutput)
}
// OverrideArrayInput is an input type that accepts OverrideArray and OverrideArrayOutput values.
// You can construct a concrete instance of `OverrideArrayInput` via:
//
// OverrideArray{ OverrideArgs{...} }
type OverrideArrayInput interface {
pulumi.Input
ToOverrideArrayOutput() OverrideArrayOutput
ToOverrideArrayOutputWithContext(context.Context) OverrideArrayOutput
}
type OverrideArray []OverrideInput
func (OverrideArray) ElementType() reflect.Type {
return reflect.TypeOf((*[]*Override)(nil)).Elem()
}
func (i OverrideArray) ToOverrideArrayOutput() OverrideArrayOutput {
return i.ToOverrideArrayOutputWithContext(context.Background())
}
func (i OverrideArray) ToOverrideArrayOutputWithContext(ctx context.Context) OverrideArrayOutput {
return pulumi.ToOutputWithContext(ctx, i).(OverrideArrayOutput)
}
// OverrideMapInput is an input type that accepts OverrideMap and OverrideMapOutput values.
// You can construct a concrete instance of `OverrideMapInput` via:
//
// OverrideMap{ "key": OverrideArgs{...} }
type OverrideMapInput interface {
pulumi.Input
ToOverrideMapOutput() OverrideMapOutput
ToOverrideMapOutputWithContext(context.Context) OverrideMapOutput
}
type OverrideMap map[string]OverrideInput
func (OverrideMap) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*Override)(nil)).Elem()
}
func (i OverrideMap) ToOverrideMapOutput() OverrideMapOutput {
return i.ToOverrideMapOutputWithContext(context.Background())
}
func (i OverrideMap) ToOverrideMapOutputWithContext(ctx context.Context) OverrideMapOutput {
return pulumi.ToOutputWithContext(ctx, i).(OverrideMapOutput)
}
type OverrideOutput struct{ *pulumi.OutputState }
func (OverrideOutput) ElementType() reflect.Type {
return reflect.TypeOf((**Override)(nil)).Elem()
}
func (o OverrideOutput) ToOverrideOutput() OverrideOutput {
return o
}
func (o OverrideOutput) ToOverrideOutputWithContext(ctx context.Context) OverrideOutput {
return o
}
// Override expiration date and time, from 5 minutes to 365 from now (format: yyyy/mm/dd hh:mm:ss).
func (o OverrideOutput) Expires() pulumi.StringOutput {
return o.ApplyT(func(v *Override) pulumi.StringOutput { return v.Expires }).(pulumi.StringOutput)
}
// Override rule ID.
func (o OverrideOutput) Fosid() pulumi.IntOutput {
return o.ApplyT(func(v *Override) pulumi.IntOutput { return v.Fosid }).(pulumi.IntOutput)
}
// Initiating user of override (read-only setting).
func (o OverrideOutput) Initiator() pulumi.StringOutput {
return o.ApplyT(func(v *Override) pulumi.StringOutput { return v.Initiator }).(pulumi.StringOutput)
}
// IPv4 address which the override applies.
func (o OverrideOutput) Ip() pulumi.StringOutput {
return o.ApplyT(func(v *Override) pulumi.StringOutput { return v.Ip }).(pulumi.StringOutput)
}
// IPv6 address which the override applies.
func (o OverrideOutput) Ip6() pulumi.StringOutput {
return o.ApplyT(func(v *Override) pulumi.StringOutput { return v.Ip6 }).(pulumi.StringOutput)
}
// Name of the new web filter profile used by the override.
func (o OverrideOutput) NewProfile() pulumi.StringOutput {
return o.ApplyT(func(v *Override) pulumi.StringOutput { return v.NewProfile }).(pulumi.StringOutput)
}
// Name of the web filter profile which the override applies.
func (o OverrideOutput) OldProfile() pulumi.StringOutput {
return o.ApplyT(func(v *Override) pulumi.StringOutput { return v.OldProfile }).(pulumi.StringOutput)
}
// Override either the specific user, user group, IPv4 address, or IPv6 address. Valid values: `user`, `user-group`, `ip`, `ip6`.
func (o OverrideOutput) Scope() pulumi.StringOutput {
return o.ApplyT(func(v *Override) pulumi.StringOutput { return v.Scope }).(pulumi.StringOutput)
}
// Enable/disable override rule. Valid values: `enable`, `disable`.
func (o OverrideOutput) Status() pulumi.StringOutput {
return o.ApplyT(func(v *Override) pulumi.StringOutput { return v.Status }).(pulumi.StringOutput)
}
// Name of the user which the override applies.
func (o OverrideOutput) User() pulumi.StringOutput {
return o.ApplyT(func(v *Override) pulumi.StringOutput { return v.User }).(pulumi.StringOutput)
}
// Specify the user group for which the override applies.
func (o OverrideOutput) UserGroup() pulumi.StringOutput {
return o.ApplyT(func(v *Override) pulumi.StringOutput { return v.UserGroup }).(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 OverrideOutput) Vdomparam() pulumi.StringPtrOutput {
return o.ApplyT(func(v *Override) pulumi.StringPtrOutput { return v.Vdomparam }).(pulumi.StringPtrOutput)
}
type OverrideArrayOutput struct{ *pulumi.OutputState }
func (OverrideArrayOutput) ElementType() reflect.Type {
return reflect.TypeOf((*[]*Override)(nil)).Elem()
}
func (o OverrideArrayOutput) ToOverrideArrayOutput() OverrideArrayOutput {
return o
}
func (o OverrideArrayOutput) ToOverrideArrayOutputWithContext(ctx context.Context) OverrideArrayOutput {
return o
}
func (o OverrideArrayOutput) Index(i pulumi.IntInput) OverrideOutput {
return pulumi.All(o, i).ApplyT(func(vs []interface{}) *Override {
return vs[0].([]*Override)[vs[1].(int)]
}).(OverrideOutput)
}
type OverrideMapOutput struct{ *pulumi.OutputState }
func (OverrideMapOutput) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*Override)(nil)).Elem()
}
func (o OverrideMapOutput) ToOverrideMapOutput() OverrideMapOutput {
return o
}
func (o OverrideMapOutput) ToOverrideMapOutputWithContext(ctx context.Context) OverrideMapOutput {
return o
}
func (o OverrideMapOutput) MapIndex(k pulumi.StringInput) OverrideOutput {
return pulumi.All(o, k).ApplyT(func(vs []interface{}) *Override {
return vs[0].(map[string]*Override)[vs[1].(string)]
}).(OverrideOutput)
}
func init() {
pulumi.RegisterInputType(reflect.TypeOf((*OverrideInput)(nil)).Elem(), &Override{})
pulumi.RegisterInputType(reflect.TypeOf((*OverrideArrayInput)(nil)).Elem(), OverrideArray{})
pulumi.RegisterInputType(reflect.TypeOf((*OverrideMapInput)(nil)).Elem(), OverrideMap{})
pulumi.RegisterOutputType(OverrideOutput{})
pulumi.RegisterOutputType(OverrideArrayOutput{})
pulumi.RegisterOutputType(OverrideMapOutput{})
}