/
profile.go
427 lines (369 loc) · 20.1 KB
/
profile.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
// 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 waf
import (
"context"
"reflect"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
"github.com/pulumiverse/pulumi-fortios/sdk/go/fortios/internal"
)
// Web application firewall configuration.
//
// ## Example Usage
//
// <!--Start PulumiCodeChooser -->
// ```go
// package main
//
// import (
//
// "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
// "github.com/pulumiverse/pulumi-fortios/sdk/go/fortios/waf"
//
// )
//
// func main() {
// pulumi.Run(func(ctx *pulumi.Context) error {
// _, err := waf.NewProfile(ctx, "trname", &waf.ProfileArgs{
// ExtendedLog: pulumi.String("disable"),
// External: pulumi.String("disable"),
// })
// if err != nil {
// return err
// }
// return nil
// })
// }
//
// ```
// <!--End PulumiCodeChooser -->
//
// ## Import
//
// Waf Profile can be imported using any of these accepted formats:
//
// ```sh
// $ pulumi import fortios:waf/profile:Profile labelname {{name}}
// ```
//
// If you do not want to import arguments of block:
//
// $ export "FORTIOS_IMPORT_TABLE"="false"
//
// ```sh
// $ pulumi import fortios:waf/profile:Profile labelname {{name}}
// ```
//
// $ unset "FORTIOS_IMPORT_TABLE"
type Profile struct {
pulumi.CustomResourceState
// Black address list and white address list. The structure of `addressList` block is documented below.
AddressList ProfileAddressListOutput `pulumi:"addressList"`
// Comment.
Comment pulumi.StringPtrOutput `pulumi:"comment"`
// WAF HTTP protocol restrictions. The structure of `constraint` block is documented below.
Constraint ProfileConstraintOutput `pulumi:"constraint"`
// 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"`
// Enable/disable extended logging. Valid values: `enable`, `disable`.
ExtendedLog pulumi.StringOutput `pulumi:"extendedLog"`
// Disable/Enable external HTTP Inspection. Valid values: `disable`, `enable`.
External pulumi.StringOutput `pulumi:"external"`
// 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"`
// Method restriction. The structure of `method` block is documented below.
Method ProfileMethodOutput `pulumi:"method"`
// WAF Profile name.
Name pulumi.StringOutput `pulumi:"name"`
// WAF signatures. The structure of `signature` block is documented below.
Signature ProfileSignatureOutput `pulumi:"signature"`
// URL access list The structure of `urlAccess` block is documented below.
UrlAccesses ProfileUrlAccessArrayOutput `pulumi:"urlAccesses"`
// 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"`
}
// NewProfile registers a new resource with the given unique name, arguments, and options.
func NewProfile(ctx *pulumi.Context,
name string, args *ProfileArgs, opts ...pulumi.ResourceOption) (*Profile, error) {
if args == nil {
args = &ProfileArgs{}
}
opts = internal.PkgResourceDefaultOpts(opts)
var resource Profile
err := ctx.RegisterResource("fortios:waf/profile:Profile", name, args, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// GetProfile gets an existing Profile 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 GetProfile(ctx *pulumi.Context,
name string, id pulumi.IDInput, state *ProfileState, opts ...pulumi.ResourceOption) (*Profile, error) {
var resource Profile
err := ctx.ReadResource("fortios:waf/profile:Profile", name, id, state, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// Input properties used for looking up and filtering Profile resources.
type profileState struct {
// Black address list and white address list. The structure of `addressList` block is documented below.
AddressList *ProfileAddressList `pulumi:"addressList"`
// Comment.
Comment *string `pulumi:"comment"`
// WAF HTTP protocol restrictions. The structure of `constraint` block is documented below.
Constraint *ProfileConstraint `pulumi:"constraint"`
// 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"`
// Enable/disable extended logging. Valid values: `enable`, `disable`.
ExtendedLog *string `pulumi:"extendedLog"`
// Disable/Enable external HTTP Inspection. Valid values: `disable`, `enable`.
External *string `pulumi:"external"`
// 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"`
// Method restriction. The structure of `method` block is documented below.
Method *ProfileMethod `pulumi:"method"`
// WAF Profile name.
Name *string `pulumi:"name"`
// WAF signatures. The structure of `signature` block is documented below.
Signature *ProfileSignature `pulumi:"signature"`
// URL access list The structure of `urlAccess` block is documented below.
UrlAccesses []ProfileUrlAccess `pulumi:"urlAccesses"`
// 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 ProfileState struct {
// Black address list and white address list. The structure of `addressList` block is documented below.
AddressList ProfileAddressListPtrInput
// Comment.
Comment pulumi.StringPtrInput
// WAF HTTP protocol restrictions. The structure of `constraint` block is documented below.
Constraint ProfileConstraintPtrInput
// 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
// Enable/disable extended logging. Valid values: `enable`, `disable`.
ExtendedLog pulumi.StringPtrInput
// Disable/Enable external HTTP Inspection. Valid values: `disable`, `enable`.
External 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
// Method restriction. The structure of `method` block is documented below.
Method ProfileMethodPtrInput
// WAF Profile name.
Name pulumi.StringPtrInput
// WAF signatures. The structure of `signature` block is documented below.
Signature ProfileSignaturePtrInput
// URL access list The structure of `urlAccess` block is documented below.
UrlAccesses ProfileUrlAccessArrayInput
// 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 (ProfileState) ElementType() reflect.Type {
return reflect.TypeOf((*profileState)(nil)).Elem()
}
type profileArgs struct {
// Black address list and white address list. The structure of `addressList` block is documented below.
AddressList *ProfileAddressList `pulumi:"addressList"`
// Comment.
Comment *string `pulumi:"comment"`
// WAF HTTP protocol restrictions. The structure of `constraint` block is documented below.
Constraint *ProfileConstraint `pulumi:"constraint"`
// 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"`
// Enable/disable extended logging. Valid values: `enable`, `disable`.
ExtendedLog *string `pulumi:"extendedLog"`
// Disable/Enable external HTTP Inspection. Valid values: `disable`, `enable`.
External *string `pulumi:"external"`
// 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"`
// Method restriction. The structure of `method` block is documented below.
Method *ProfileMethod `pulumi:"method"`
// WAF Profile name.
Name *string `pulumi:"name"`
// WAF signatures. The structure of `signature` block is documented below.
Signature *ProfileSignature `pulumi:"signature"`
// URL access list The structure of `urlAccess` block is documented below.
UrlAccesses []ProfileUrlAccess `pulumi:"urlAccesses"`
// 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 Profile resource.
type ProfileArgs struct {
// Black address list and white address list. The structure of `addressList` block is documented below.
AddressList ProfileAddressListPtrInput
// Comment.
Comment pulumi.StringPtrInput
// WAF HTTP protocol restrictions. The structure of `constraint` block is documented below.
Constraint ProfileConstraintPtrInput
// 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
// Enable/disable extended logging. Valid values: `enable`, `disable`.
ExtendedLog pulumi.StringPtrInput
// Disable/Enable external HTTP Inspection. Valid values: `disable`, `enable`.
External 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
// Method restriction. The structure of `method` block is documented below.
Method ProfileMethodPtrInput
// WAF Profile name.
Name pulumi.StringPtrInput
// WAF signatures. The structure of `signature` block is documented below.
Signature ProfileSignaturePtrInput
// URL access list The structure of `urlAccess` block is documented below.
UrlAccesses ProfileUrlAccessArrayInput
// 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 (ProfileArgs) ElementType() reflect.Type {
return reflect.TypeOf((*profileArgs)(nil)).Elem()
}
type ProfileInput interface {
pulumi.Input
ToProfileOutput() ProfileOutput
ToProfileOutputWithContext(ctx context.Context) ProfileOutput
}
func (*Profile) ElementType() reflect.Type {
return reflect.TypeOf((**Profile)(nil)).Elem()
}
func (i *Profile) ToProfileOutput() ProfileOutput {
return i.ToProfileOutputWithContext(context.Background())
}
func (i *Profile) ToProfileOutputWithContext(ctx context.Context) ProfileOutput {
return pulumi.ToOutputWithContext(ctx, i).(ProfileOutput)
}
// ProfileArrayInput is an input type that accepts ProfileArray and ProfileArrayOutput values.
// You can construct a concrete instance of `ProfileArrayInput` via:
//
// ProfileArray{ ProfileArgs{...} }
type ProfileArrayInput interface {
pulumi.Input
ToProfileArrayOutput() ProfileArrayOutput
ToProfileArrayOutputWithContext(context.Context) ProfileArrayOutput
}
type ProfileArray []ProfileInput
func (ProfileArray) ElementType() reflect.Type {
return reflect.TypeOf((*[]*Profile)(nil)).Elem()
}
func (i ProfileArray) ToProfileArrayOutput() ProfileArrayOutput {
return i.ToProfileArrayOutputWithContext(context.Background())
}
func (i ProfileArray) ToProfileArrayOutputWithContext(ctx context.Context) ProfileArrayOutput {
return pulumi.ToOutputWithContext(ctx, i).(ProfileArrayOutput)
}
// ProfileMapInput is an input type that accepts ProfileMap and ProfileMapOutput values.
// You can construct a concrete instance of `ProfileMapInput` via:
//
// ProfileMap{ "key": ProfileArgs{...} }
type ProfileMapInput interface {
pulumi.Input
ToProfileMapOutput() ProfileMapOutput
ToProfileMapOutputWithContext(context.Context) ProfileMapOutput
}
type ProfileMap map[string]ProfileInput
func (ProfileMap) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*Profile)(nil)).Elem()
}
func (i ProfileMap) ToProfileMapOutput() ProfileMapOutput {
return i.ToProfileMapOutputWithContext(context.Background())
}
func (i ProfileMap) ToProfileMapOutputWithContext(ctx context.Context) ProfileMapOutput {
return pulumi.ToOutputWithContext(ctx, i).(ProfileMapOutput)
}
type ProfileOutput struct{ *pulumi.OutputState }
func (ProfileOutput) ElementType() reflect.Type {
return reflect.TypeOf((**Profile)(nil)).Elem()
}
func (o ProfileOutput) ToProfileOutput() ProfileOutput {
return o
}
func (o ProfileOutput) ToProfileOutputWithContext(ctx context.Context) ProfileOutput {
return o
}
// Black address list and white address list. The structure of `addressList` block is documented below.
func (o ProfileOutput) AddressList() ProfileAddressListOutput {
return o.ApplyT(func(v *Profile) ProfileAddressListOutput { return v.AddressList }).(ProfileAddressListOutput)
}
// Comment.
func (o ProfileOutput) Comment() pulumi.StringPtrOutput {
return o.ApplyT(func(v *Profile) pulumi.StringPtrOutput { return v.Comment }).(pulumi.StringPtrOutput)
}
// WAF HTTP protocol restrictions. The structure of `constraint` block is documented below.
func (o ProfileOutput) Constraint() ProfileConstraintOutput {
return o.ApplyT(func(v *Profile) ProfileConstraintOutput { return v.Constraint }).(ProfileConstraintOutput)
}
// 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 ProfileOutput) DynamicSortSubtable() pulumi.StringPtrOutput {
return o.ApplyT(func(v *Profile) pulumi.StringPtrOutput { return v.DynamicSortSubtable }).(pulumi.StringPtrOutput)
}
// Enable/disable extended logging. Valid values: `enable`, `disable`.
func (o ProfileOutput) ExtendedLog() pulumi.StringOutput {
return o.ApplyT(func(v *Profile) pulumi.StringOutput { return v.ExtendedLog }).(pulumi.StringOutput)
}
// Disable/Enable external HTTP Inspection. Valid values: `disable`, `enable`.
func (o ProfileOutput) External() pulumi.StringOutput {
return o.ApplyT(func(v *Profile) pulumi.StringOutput { return v.External }).(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 ProfileOutput) GetAllTables() pulumi.StringPtrOutput {
return o.ApplyT(func(v *Profile) pulumi.StringPtrOutput { return v.GetAllTables }).(pulumi.StringPtrOutput)
}
// Method restriction. The structure of `method` block is documented below.
func (o ProfileOutput) Method() ProfileMethodOutput {
return o.ApplyT(func(v *Profile) ProfileMethodOutput { return v.Method }).(ProfileMethodOutput)
}
// WAF Profile name.
func (o ProfileOutput) Name() pulumi.StringOutput {
return o.ApplyT(func(v *Profile) pulumi.StringOutput { return v.Name }).(pulumi.StringOutput)
}
// WAF signatures. The structure of `signature` block is documented below.
func (o ProfileOutput) Signature() ProfileSignatureOutput {
return o.ApplyT(func(v *Profile) ProfileSignatureOutput { return v.Signature }).(ProfileSignatureOutput)
}
// URL access list The structure of `urlAccess` block is documented below.
func (o ProfileOutput) UrlAccesses() ProfileUrlAccessArrayOutput {
return o.ApplyT(func(v *Profile) ProfileUrlAccessArrayOutput { return v.UrlAccesses }).(ProfileUrlAccessArrayOutput)
}
// 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 ProfileOutput) Vdomparam() pulumi.StringPtrOutput {
return o.ApplyT(func(v *Profile) pulumi.StringPtrOutput { return v.Vdomparam }).(pulumi.StringPtrOutput)
}
type ProfileArrayOutput struct{ *pulumi.OutputState }
func (ProfileArrayOutput) ElementType() reflect.Type {
return reflect.TypeOf((*[]*Profile)(nil)).Elem()
}
func (o ProfileArrayOutput) ToProfileArrayOutput() ProfileArrayOutput {
return o
}
func (o ProfileArrayOutput) ToProfileArrayOutputWithContext(ctx context.Context) ProfileArrayOutput {
return o
}
func (o ProfileArrayOutput) Index(i pulumi.IntInput) ProfileOutput {
return pulumi.All(o, i).ApplyT(func(vs []interface{}) *Profile {
return vs[0].([]*Profile)[vs[1].(int)]
}).(ProfileOutput)
}
type ProfileMapOutput struct{ *pulumi.OutputState }
func (ProfileMapOutput) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*Profile)(nil)).Elem()
}
func (o ProfileMapOutput) ToProfileMapOutput() ProfileMapOutput {
return o
}
func (o ProfileMapOutput) ToProfileMapOutputWithContext(ctx context.Context) ProfileMapOutput {
return o
}
func (o ProfileMapOutput) MapIndex(k pulumi.StringInput) ProfileOutput {
return pulumi.All(o, k).ApplyT(func(vs []interface{}) *Profile {
return vs[0].(map[string]*Profile)[vs[1].(string)]
}).(ProfileOutput)
}
func init() {
pulumi.RegisterInputType(reflect.TypeOf((*ProfileInput)(nil)).Elem(), &Profile{})
pulumi.RegisterInputType(reflect.TypeOf((*ProfileArrayInput)(nil)).Elem(), ProfileArray{})
pulumi.RegisterInputType(reflect.TypeOf((*ProfileMapInput)(nil)).Elem(), ProfileMap{})
pulumi.RegisterOutputType(ProfileOutput{})
pulumi.RegisterOutputType(ProfileArrayOutput{})
pulumi.RegisterOutputType(ProfileMapOutput{})
}