/
crl.go
450 lines (389 loc) · 16.1 KB
/
crl.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
// 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 certificate
import (
"context"
"reflect"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
"github.com/pulumiverse/pulumi-fortios/sdk/go/fortios/internal"
)
// Certificate Revocation List as a PEM file.
//
// ## Import
//
// Certificate Crl can be imported using any of these accepted formats:
//
// ```sh
// $ pulumi import fortios:certificate/crl:Crl labelname {{name}}
// ```
//
// If you do not want to import arguments of block:
//
// $ export "FORTIOS_IMPORT_TABLE"="false"
//
// ```sh
// $ pulumi import fortios:certificate/crl:Crl labelname {{name}}
// ```
//
// $ unset "FORTIOS_IMPORT_TABLE"
type Crl struct {
pulumi.CustomResourceState
// Certificate Revocation List as a PEM file.
Crl pulumi.StringOutput `pulumi:"crl"`
// HTTP server URL for CRL auto-update.
HttpUrl pulumi.StringOutput `pulumi:"httpUrl"`
// Time at which CRL was last updated.
LastUpdated pulumi.IntOutput `pulumi:"lastUpdated"`
// LDAP server user password.
LdapPassword pulumi.StringPtrOutput `pulumi:"ldapPassword"`
// LDAP server name for CRL auto-update.
LdapServer pulumi.StringOutput `pulumi:"ldapServer"`
// LDAP server user name.
LdapUsername pulumi.StringOutput `pulumi:"ldapUsername"`
// Name.
Name pulumi.StringOutput `pulumi:"name"`
// Either global or VDOM IP address range for the certificate. Valid values: `global`, `vdom`.
Range pulumi.StringOutput `pulumi:"range"`
// Local certificate for SCEP communication for CRL auto-update.
ScepCert pulumi.StringOutput `pulumi:"scepCert"`
// SCEP server URL for CRL auto-update.
ScepUrl pulumi.StringOutput `pulumi:"scepUrl"`
// Certificate source type.
Source pulumi.StringOutput `pulumi:"source"`
// Source IP address for communications to a HTTP or SCEP CA server.
SourceIp pulumi.StringOutput `pulumi:"sourceIp"`
// Time in seconds before the FortiGate checks for an updated CRL. Set to 0 to update only when it expires.
UpdateInterval pulumi.IntOutput `pulumi:"updateInterval"`
// VDOM for CRL update.
UpdateVdom pulumi.StringOutput `pulumi:"updateVdom"`
// 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"`
}
// NewCrl registers a new resource with the given unique name, arguments, and options.
func NewCrl(ctx *pulumi.Context,
name string, args *CrlArgs, opts ...pulumi.ResourceOption) (*Crl, error) {
if args == nil {
args = &CrlArgs{}
}
if args.LdapPassword != nil {
args.LdapPassword = pulumi.ToSecret(args.LdapPassword).(pulumi.StringPtrInput)
}
secrets := pulumi.AdditionalSecretOutputs([]string{
"ldapPassword",
})
opts = append(opts, secrets)
opts = internal.PkgResourceDefaultOpts(opts)
var resource Crl
err := ctx.RegisterResource("fortios:certificate/crl:Crl", name, args, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// GetCrl gets an existing Crl 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 GetCrl(ctx *pulumi.Context,
name string, id pulumi.IDInput, state *CrlState, opts ...pulumi.ResourceOption) (*Crl, error) {
var resource Crl
err := ctx.ReadResource("fortios:certificate/crl:Crl", name, id, state, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// Input properties used for looking up and filtering Crl resources.
type crlState struct {
// Certificate Revocation List as a PEM file.
Crl *string `pulumi:"crl"`
// HTTP server URL for CRL auto-update.
HttpUrl *string `pulumi:"httpUrl"`
// Time at which CRL was last updated.
LastUpdated *int `pulumi:"lastUpdated"`
// LDAP server user password.
LdapPassword *string `pulumi:"ldapPassword"`
// LDAP server name for CRL auto-update.
LdapServer *string `pulumi:"ldapServer"`
// LDAP server user name.
LdapUsername *string `pulumi:"ldapUsername"`
// Name.
Name *string `pulumi:"name"`
// Either global or VDOM IP address range for the certificate. Valid values: `global`, `vdom`.
Range *string `pulumi:"range"`
// Local certificate for SCEP communication for CRL auto-update.
ScepCert *string `pulumi:"scepCert"`
// SCEP server URL for CRL auto-update.
ScepUrl *string `pulumi:"scepUrl"`
// Certificate source type.
Source *string `pulumi:"source"`
// Source IP address for communications to a HTTP or SCEP CA server.
SourceIp *string `pulumi:"sourceIp"`
// Time in seconds before the FortiGate checks for an updated CRL. Set to 0 to update only when it expires.
UpdateInterval *int `pulumi:"updateInterval"`
// VDOM for CRL update.
UpdateVdom *string `pulumi:"updateVdom"`
// 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 CrlState struct {
// Certificate Revocation List as a PEM file.
Crl pulumi.StringPtrInput
// HTTP server URL for CRL auto-update.
HttpUrl pulumi.StringPtrInput
// Time at which CRL was last updated.
LastUpdated pulumi.IntPtrInput
// LDAP server user password.
LdapPassword pulumi.StringPtrInput
// LDAP server name for CRL auto-update.
LdapServer pulumi.StringPtrInput
// LDAP server user name.
LdapUsername pulumi.StringPtrInput
// Name.
Name pulumi.StringPtrInput
// Either global or VDOM IP address range for the certificate. Valid values: `global`, `vdom`.
Range pulumi.StringPtrInput
// Local certificate for SCEP communication for CRL auto-update.
ScepCert pulumi.StringPtrInput
// SCEP server URL for CRL auto-update.
ScepUrl pulumi.StringPtrInput
// Certificate source type.
Source pulumi.StringPtrInput
// Source IP address for communications to a HTTP or SCEP CA server.
SourceIp pulumi.StringPtrInput
// Time in seconds before the FortiGate checks for an updated CRL. Set to 0 to update only when it expires.
UpdateInterval pulumi.IntPtrInput
// VDOM for CRL update.
UpdateVdom 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 (CrlState) ElementType() reflect.Type {
return reflect.TypeOf((*crlState)(nil)).Elem()
}
type crlArgs struct {
// Certificate Revocation List as a PEM file.
Crl *string `pulumi:"crl"`
// HTTP server URL for CRL auto-update.
HttpUrl *string `pulumi:"httpUrl"`
// Time at which CRL was last updated.
LastUpdated *int `pulumi:"lastUpdated"`
// LDAP server user password.
LdapPassword *string `pulumi:"ldapPassword"`
// LDAP server name for CRL auto-update.
LdapServer *string `pulumi:"ldapServer"`
// LDAP server user name.
LdapUsername *string `pulumi:"ldapUsername"`
// Name.
Name *string `pulumi:"name"`
// Either global or VDOM IP address range for the certificate. Valid values: `global`, `vdom`.
Range *string `pulumi:"range"`
// Local certificate for SCEP communication for CRL auto-update.
ScepCert *string `pulumi:"scepCert"`
// SCEP server URL for CRL auto-update.
ScepUrl *string `pulumi:"scepUrl"`
// Certificate source type.
Source *string `pulumi:"source"`
// Source IP address for communications to a HTTP or SCEP CA server.
SourceIp *string `pulumi:"sourceIp"`
// Time in seconds before the FortiGate checks for an updated CRL. Set to 0 to update only when it expires.
UpdateInterval *int `pulumi:"updateInterval"`
// VDOM for CRL update.
UpdateVdom *string `pulumi:"updateVdom"`
// 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 Crl resource.
type CrlArgs struct {
// Certificate Revocation List as a PEM file.
Crl pulumi.StringPtrInput
// HTTP server URL for CRL auto-update.
HttpUrl pulumi.StringPtrInput
// Time at which CRL was last updated.
LastUpdated pulumi.IntPtrInput
// LDAP server user password.
LdapPassword pulumi.StringPtrInput
// LDAP server name for CRL auto-update.
LdapServer pulumi.StringPtrInput
// LDAP server user name.
LdapUsername pulumi.StringPtrInput
// Name.
Name pulumi.StringPtrInput
// Either global or VDOM IP address range for the certificate. Valid values: `global`, `vdom`.
Range pulumi.StringPtrInput
// Local certificate for SCEP communication for CRL auto-update.
ScepCert pulumi.StringPtrInput
// SCEP server URL for CRL auto-update.
ScepUrl pulumi.StringPtrInput
// Certificate source type.
Source pulumi.StringPtrInput
// Source IP address for communications to a HTTP or SCEP CA server.
SourceIp pulumi.StringPtrInput
// Time in seconds before the FortiGate checks for an updated CRL. Set to 0 to update only when it expires.
UpdateInterval pulumi.IntPtrInput
// VDOM for CRL update.
UpdateVdom 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 (CrlArgs) ElementType() reflect.Type {
return reflect.TypeOf((*crlArgs)(nil)).Elem()
}
type CrlInput interface {
pulumi.Input
ToCrlOutput() CrlOutput
ToCrlOutputWithContext(ctx context.Context) CrlOutput
}
func (*Crl) ElementType() reflect.Type {
return reflect.TypeOf((**Crl)(nil)).Elem()
}
func (i *Crl) ToCrlOutput() CrlOutput {
return i.ToCrlOutputWithContext(context.Background())
}
func (i *Crl) ToCrlOutputWithContext(ctx context.Context) CrlOutput {
return pulumi.ToOutputWithContext(ctx, i).(CrlOutput)
}
// CrlArrayInput is an input type that accepts CrlArray and CrlArrayOutput values.
// You can construct a concrete instance of `CrlArrayInput` via:
//
// CrlArray{ CrlArgs{...} }
type CrlArrayInput interface {
pulumi.Input
ToCrlArrayOutput() CrlArrayOutput
ToCrlArrayOutputWithContext(context.Context) CrlArrayOutput
}
type CrlArray []CrlInput
func (CrlArray) ElementType() reflect.Type {
return reflect.TypeOf((*[]*Crl)(nil)).Elem()
}
func (i CrlArray) ToCrlArrayOutput() CrlArrayOutput {
return i.ToCrlArrayOutputWithContext(context.Background())
}
func (i CrlArray) ToCrlArrayOutputWithContext(ctx context.Context) CrlArrayOutput {
return pulumi.ToOutputWithContext(ctx, i).(CrlArrayOutput)
}
// CrlMapInput is an input type that accepts CrlMap and CrlMapOutput values.
// You can construct a concrete instance of `CrlMapInput` via:
//
// CrlMap{ "key": CrlArgs{...} }
type CrlMapInput interface {
pulumi.Input
ToCrlMapOutput() CrlMapOutput
ToCrlMapOutputWithContext(context.Context) CrlMapOutput
}
type CrlMap map[string]CrlInput
func (CrlMap) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*Crl)(nil)).Elem()
}
func (i CrlMap) ToCrlMapOutput() CrlMapOutput {
return i.ToCrlMapOutputWithContext(context.Background())
}
func (i CrlMap) ToCrlMapOutputWithContext(ctx context.Context) CrlMapOutput {
return pulumi.ToOutputWithContext(ctx, i).(CrlMapOutput)
}
type CrlOutput struct{ *pulumi.OutputState }
func (CrlOutput) ElementType() reflect.Type {
return reflect.TypeOf((**Crl)(nil)).Elem()
}
func (o CrlOutput) ToCrlOutput() CrlOutput {
return o
}
func (o CrlOutput) ToCrlOutputWithContext(ctx context.Context) CrlOutput {
return o
}
// Certificate Revocation List as a PEM file.
func (o CrlOutput) Crl() pulumi.StringOutput {
return o.ApplyT(func(v *Crl) pulumi.StringOutput { return v.Crl }).(pulumi.StringOutput)
}
// HTTP server URL for CRL auto-update.
func (o CrlOutput) HttpUrl() pulumi.StringOutput {
return o.ApplyT(func(v *Crl) pulumi.StringOutput { return v.HttpUrl }).(pulumi.StringOutput)
}
// Time at which CRL was last updated.
func (o CrlOutput) LastUpdated() pulumi.IntOutput {
return o.ApplyT(func(v *Crl) pulumi.IntOutput { return v.LastUpdated }).(pulumi.IntOutput)
}
// LDAP server user password.
func (o CrlOutput) LdapPassword() pulumi.StringPtrOutput {
return o.ApplyT(func(v *Crl) pulumi.StringPtrOutput { return v.LdapPassword }).(pulumi.StringPtrOutput)
}
// LDAP server name for CRL auto-update.
func (o CrlOutput) LdapServer() pulumi.StringOutput {
return o.ApplyT(func(v *Crl) pulumi.StringOutput { return v.LdapServer }).(pulumi.StringOutput)
}
// LDAP server user name.
func (o CrlOutput) LdapUsername() pulumi.StringOutput {
return o.ApplyT(func(v *Crl) pulumi.StringOutput { return v.LdapUsername }).(pulumi.StringOutput)
}
// Name.
func (o CrlOutput) Name() pulumi.StringOutput {
return o.ApplyT(func(v *Crl) pulumi.StringOutput { return v.Name }).(pulumi.StringOutput)
}
// Either global or VDOM IP address range for the certificate. Valid values: `global`, `vdom`.
func (o CrlOutput) Range() pulumi.StringOutput {
return o.ApplyT(func(v *Crl) pulumi.StringOutput { return v.Range }).(pulumi.StringOutput)
}
// Local certificate for SCEP communication for CRL auto-update.
func (o CrlOutput) ScepCert() pulumi.StringOutput {
return o.ApplyT(func(v *Crl) pulumi.StringOutput { return v.ScepCert }).(pulumi.StringOutput)
}
// SCEP server URL for CRL auto-update.
func (o CrlOutput) ScepUrl() pulumi.StringOutput {
return o.ApplyT(func(v *Crl) pulumi.StringOutput { return v.ScepUrl }).(pulumi.StringOutput)
}
// Certificate source type.
func (o CrlOutput) Source() pulumi.StringOutput {
return o.ApplyT(func(v *Crl) pulumi.StringOutput { return v.Source }).(pulumi.StringOutput)
}
// Source IP address for communications to a HTTP or SCEP CA server.
func (o CrlOutput) SourceIp() pulumi.StringOutput {
return o.ApplyT(func(v *Crl) pulumi.StringOutput { return v.SourceIp }).(pulumi.StringOutput)
}
// Time in seconds before the FortiGate checks for an updated CRL. Set to 0 to update only when it expires.
func (o CrlOutput) UpdateInterval() pulumi.IntOutput {
return o.ApplyT(func(v *Crl) pulumi.IntOutput { return v.UpdateInterval }).(pulumi.IntOutput)
}
// VDOM for CRL update.
func (o CrlOutput) UpdateVdom() pulumi.StringOutput {
return o.ApplyT(func(v *Crl) pulumi.StringOutput { return v.UpdateVdom }).(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 CrlOutput) Vdomparam() pulumi.StringPtrOutput {
return o.ApplyT(func(v *Crl) pulumi.StringPtrOutput { return v.Vdomparam }).(pulumi.StringPtrOutput)
}
type CrlArrayOutput struct{ *pulumi.OutputState }
func (CrlArrayOutput) ElementType() reflect.Type {
return reflect.TypeOf((*[]*Crl)(nil)).Elem()
}
func (o CrlArrayOutput) ToCrlArrayOutput() CrlArrayOutput {
return o
}
func (o CrlArrayOutput) ToCrlArrayOutputWithContext(ctx context.Context) CrlArrayOutput {
return o
}
func (o CrlArrayOutput) Index(i pulumi.IntInput) CrlOutput {
return pulumi.All(o, i).ApplyT(func(vs []interface{}) *Crl {
return vs[0].([]*Crl)[vs[1].(int)]
}).(CrlOutput)
}
type CrlMapOutput struct{ *pulumi.OutputState }
func (CrlMapOutput) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*Crl)(nil)).Elem()
}
func (o CrlMapOutput) ToCrlMapOutput() CrlMapOutput {
return o
}
func (o CrlMapOutput) ToCrlMapOutputWithContext(ctx context.Context) CrlMapOutput {
return o
}
func (o CrlMapOutput) MapIndex(k pulumi.StringInput) CrlOutput {
return pulumi.All(o, k).ApplyT(func(vs []interface{}) *Crl {
return vs[0].(map[string]*Crl)[vs[1].(string)]
}).(CrlOutput)
}
func init() {
pulumi.RegisterInputType(reflect.TypeOf((*CrlInput)(nil)).Elem(), &Crl{})
pulumi.RegisterInputType(reflect.TypeOf((*CrlArrayInput)(nil)).Elem(), CrlArray{})
pulumi.RegisterInputType(reflect.TypeOf((*CrlMapInput)(nil)).Elem(), CrlMap{})
pulumi.RegisterOutputType(CrlOutput{})
pulumi.RegisterOutputType(CrlArrayOutput{})
pulumi.RegisterOutputType(CrlMapOutput{})
}