/
snmpTraps.go
441 lines (381 loc) · 16.4 KB
/
snmpTraps.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
// 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 sys
import (
"context"
"reflect"
"github.com/pulumi/pulumi-f5bigip/sdk/v3/go/f5bigip/internal"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
// `sys.SnmpTraps` provides details bout how to enable snmpTraps resource on BIG-IP
// ## Example Usage
//
// <!--Start PulumiCodeChooser -->
// ```go
// package main
//
// import (
//
// "github.com/pulumi/pulumi-f5bigip/sdk/v3/go/f5bigip/sys"
// "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
//
// )
//
// func main() {
// pulumi.Run(func(ctx *pulumi.Context) error {
// _, err := sys.NewSnmpTraps(ctx, "snmpTraps", &sys.SnmpTrapsArgs{
// Community: pulumi.String("f5community"),
// Description: pulumi.String("Setup snmp traps"),
// Host: pulumi.String("195.10.10.1"),
// Name: pulumi.String("snmptraps"),
// Port: pulumi.Int(111),
// })
// if err != nil {
// return err
// }
// return nil
// })
// }
//
// ```
// <!--End PulumiCodeChooser -->
type SnmpTraps struct {
pulumi.CustomResourceState
// Encrypted password
AuthPasswordencrypted pulumi.StringPtrOutput `pulumi:"authPasswordencrypted"`
// Specifies the protocol used to authenticate the user.
AuthProtocol pulumi.StringPtrOutput `pulumi:"authProtocol"`
// Specifies the community string used for this trap.
Community pulumi.StringPtrOutput `pulumi:"community"`
// The port that the trap will be sent to.
Description pulumi.StringPtrOutput `pulumi:"description"`
// Specifies the authoritative security engine for SNMPv3.
EngineId pulumi.StringPtrOutput `pulumi:"engineId"`
// The host the trap will be sent to.
Host pulumi.StringPtrOutput `pulumi:"host"`
// Name of the snmp trap.
Name pulumi.StringPtrOutput `pulumi:"name"`
// User defined description.
Port pulumi.IntPtrOutput `pulumi:"port"`
// Specifies the clear text password used to encrypt traffic. This field will not be displayed.
PrivacyPassword pulumi.StringPtrOutput `pulumi:"privacyPassword"`
// Specifies the encrypted password used to encrypt traffic.
PrivacyPasswordEncrypted pulumi.StringPtrOutput `pulumi:"privacyPasswordEncrypted"`
// Specifies the protocol used to encrypt traffic.
PrivacyProtocol pulumi.StringPtrOutput `pulumi:"privacyProtocol"`
// Specifies whether or not traffic is encrypted and whether or not authentication is required.
SecurityLevel pulumi.StringOutput `pulumi:"securityLevel"`
// Security name used in conjunction with SNMPv3.
SecurityName pulumi.StringPtrOutput `pulumi:"securityName"`
// SNMP version used for sending the trap.
Version pulumi.StringOutput `pulumi:"version"`
}
// NewSnmpTraps registers a new resource with the given unique name, arguments, and options.
func NewSnmpTraps(ctx *pulumi.Context,
name string, args *SnmpTrapsArgs, opts ...pulumi.ResourceOption) (*SnmpTraps, error) {
if args == nil {
args = &SnmpTrapsArgs{}
}
opts = internal.PkgResourceDefaultOpts(opts)
var resource SnmpTraps
err := ctx.RegisterResource("f5bigip:sys/snmpTraps:SnmpTraps", name, args, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// GetSnmpTraps gets an existing SnmpTraps 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 GetSnmpTraps(ctx *pulumi.Context,
name string, id pulumi.IDInput, state *SnmpTrapsState, opts ...pulumi.ResourceOption) (*SnmpTraps, error) {
var resource SnmpTraps
err := ctx.ReadResource("f5bigip:sys/snmpTraps:SnmpTraps", name, id, state, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// Input properties used for looking up and filtering SnmpTraps resources.
type snmpTrapsState struct {
// Encrypted password
AuthPasswordencrypted *string `pulumi:"authPasswordencrypted"`
// Specifies the protocol used to authenticate the user.
AuthProtocol *string `pulumi:"authProtocol"`
// Specifies the community string used for this trap.
Community *string `pulumi:"community"`
// The port that the trap will be sent to.
Description *string `pulumi:"description"`
// Specifies the authoritative security engine for SNMPv3.
EngineId *string `pulumi:"engineId"`
// The host the trap will be sent to.
Host *string `pulumi:"host"`
// Name of the snmp trap.
Name *string `pulumi:"name"`
// User defined description.
Port *int `pulumi:"port"`
// Specifies the clear text password used to encrypt traffic. This field will not be displayed.
PrivacyPassword *string `pulumi:"privacyPassword"`
// Specifies the encrypted password used to encrypt traffic.
PrivacyPasswordEncrypted *string `pulumi:"privacyPasswordEncrypted"`
// Specifies the protocol used to encrypt traffic.
PrivacyProtocol *string `pulumi:"privacyProtocol"`
// Specifies whether or not traffic is encrypted and whether or not authentication is required.
SecurityLevel *string `pulumi:"securityLevel"`
// Security name used in conjunction with SNMPv3.
SecurityName *string `pulumi:"securityName"`
// SNMP version used for sending the trap.
Version *string `pulumi:"version"`
}
type SnmpTrapsState struct {
// Encrypted password
AuthPasswordencrypted pulumi.StringPtrInput
// Specifies the protocol used to authenticate the user.
AuthProtocol pulumi.StringPtrInput
// Specifies the community string used for this trap.
Community pulumi.StringPtrInput
// The port that the trap will be sent to.
Description pulumi.StringPtrInput
// Specifies the authoritative security engine for SNMPv3.
EngineId pulumi.StringPtrInput
// The host the trap will be sent to.
Host pulumi.StringPtrInput
// Name of the snmp trap.
Name pulumi.StringPtrInput
// User defined description.
Port pulumi.IntPtrInput
// Specifies the clear text password used to encrypt traffic. This field will not be displayed.
PrivacyPassword pulumi.StringPtrInput
// Specifies the encrypted password used to encrypt traffic.
PrivacyPasswordEncrypted pulumi.StringPtrInput
// Specifies the protocol used to encrypt traffic.
PrivacyProtocol pulumi.StringPtrInput
// Specifies whether or not traffic is encrypted and whether or not authentication is required.
SecurityLevel pulumi.StringPtrInput
// Security name used in conjunction with SNMPv3.
SecurityName pulumi.StringPtrInput
// SNMP version used for sending the trap.
Version pulumi.StringPtrInput
}
func (SnmpTrapsState) ElementType() reflect.Type {
return reflect.TypeOf((*snmpTrapsState)(nil)).Elem()
}
type snmpTrapsArgs struct {
// Encrypted password
AuthPasswordencrypted *string `pulumi:"authPasswordencrypted"`
// Specifies the protocol used to authenticate the user.
AuthProtocol *string `pulumi:"authProtocol"`
// Specifies the community string used for this trap.
Community *string `pulumi:"community"`
// The port that the trap will be sent to.
Description *string `pulumi:"description"`
// Specifies the authoritative security engine for SNMPv3.
EngineId *string `pulumi:"engineId"`
// The host the trap will be sent to.
Host *string `pulumi:"host"`
// Name of the snmp trap.
Name *string `pulumi:"name"`
// User defined description.
Port *int `pulumi:"port"`
// Specifies the clear text password used to encrypt traffic. This field will not be displayed.
PrivacyPassword *string `pulumi:"privacyPassword"`
// Specifies the encrypted password used to encrypt traffic.
PrivacyPasswordEncrypted *string `pulumi:"privacyPasswordEncrypted"`
// Specifies the protocol used to encrypt traffic.
PrivacyProtocol *string `pulumi:"privacyProtocol"`
// Specifies whether or not traffic is encrypted and whether or not authentication is required.
SecurityLevel *string `pulumi:"securityLevel"`
// Security name used in conjunction with SNMPv3.
SecurityName *string `pulumi:"securityName"`
// SNMP version used for sending the trap.
Version *string `pulumi:"version"`
}
// The set of arguments for constructing a SnmpTraps resource.
type SnmpTrapsArgs struct {
// Encrypted password
AuthPasswordencrypted pulumi.StringPtrInput
// Specifies the protocol used to authenticate the user.
AuthProtocol pulumi.StringPtrInput
// Specifies the community string used for this trap.
Community pulumi.StringPtrInput
// The port that the trap will be sent to.
Description pulumi.StringPtrInput
// Specifies the authoritative security engine for SNMPv3.
EngineId pulumi.StringPtrInput
// The host the trap will be sent to.
Host pulumi.StringPtrInput
// Name of the snmp trap.
Name pulumi.StringPtrInput
// User defined description.
Port pulumi.IntPtrInput
// Specifies the clear text password used to encrypt traffic. This field will not be displayed.
PrivacyPassword pulumi.StringPtrInput
// Specifies the encrypted password used to encrypt traffic.
PrivacyPasswordEncrypted pulumi.StringPtrInput
// Specifies the protocol used to encrypt traffic.
PrivacyProtocol pulumi.StringPtrInput
// Specifies whether or not traffic is encrypted and whether or not authentication is required.
SecurityLevel pulumi.StringPtrInput
// Security name used in conjunction with SNMPv3.
SecurityName pulumi.StringPtrInput
// SNMP version used for sending the trap.
Version pulumi.StringPtrInput
}
func (SnmpTrapsArgs) ElementType() reflect.Type {
return reflect.TypeOf((*snmpTrapsArgs)(nil)).Elem()
}
type SnmpTrapsInput interface {
pulumi.Input
ToSnmpTrapsOutput() SnmpTrapsOutput
ToSnmpTrapsOutputWithContext(ctx context.Context) SnmpTrapsOutput
}
func (*SnmpTraps) ElementType() reflect.Type {
return reflect.TypeOf((**SnmpTraps)(nil)).Elem()
}
func (i *SnmpTraps) ToSnmpTrapsOutput() SnmpTrapsOutput {
return i.ToSnmpTrapsOutputWithContext(context.Background())
}
func (i *SnmpTraps) ToSnmpTrapsOutputWithContext(ctx context.Context) SnmpTrapsOutput {
return pulumi.ToOutputWithContext(ctx, i).(SnmpTrapsOutput)
}
// SnmpTrapsArrayInput is an input type that accepts SnmpTrapsArray and SnmpTrapsArrayOutput values.
// You can construct a concrete instance of `SnmpTrapsArrayInput` via:
//
// SnmpTrapsArray{ SnmpTrapsArgs{...} }
type SnmpTrapsArrayInput interface {
pulumi.Input
ToSnmpTrapsArrayOutput() SnmpTrapsArrayOutput
ToSnmpTrapsArrayOutputWithContext(context.Context) SnmpTrapsArrayOutput
}
type SnmpTrapsArray []SnmpTrapsInput
func (SnmpTrapsArray) ElementType() reflect.Type {
return reflect.TypeOf((*[]*SnmpTraps)(nil)).Elem()
}
func (i SnmpTrapsArray) ToSnmpTrapsArrayOutput() SnmpTrapsArrayOutput {
return i.ToSnmpTrapsArrayOutputWithContext(context.Background())
}
func (i SnmpTrapsArray) ToSnmpTrapsArrayOutputWithContext(ctx context.Context) SnmpTrapsArrayOutput {
return pulumi.ToOutputWithContext(ctx, i).(SnmpTrapsArrayOutput)
}
// SnmpTrapsMapInput is an input type that accepts SnmpTrapsMap and SnmpTrapsMapOutput values.
// You can construct a concrete instance of `SnmpTrapsMapInput` via:
//
// SnmpTrapsMap{ "key": SnmpTrapsArgs{...} }
type SnmpTrapsMapInput interface {
pulumi.Input
ToSnmpTrapsMapOutput() SnmpTrapsMapOutput
ToSnmpTrapsMapOutputWithContext(context.Context) SnmpTrapsMapOutput
}
type SnmpTrapsMap map[string]SnmpTrapsInput
func (SnmpTrapsMap) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*SnmpTraps)(nil)).Elem()
}
func (i SnmpTrapsMap) ToSnmpTrapsMapOutput() SnmpTrapsMapOutput {
return i.ToSnmpTrapsMapOutputWithContext(context.Background())
}
func (i SnmpTrapsMap) ToSnmpTrapsMapOutputWithContext(ctx context.Context) SnmpTrapsMapOutput {
return pulumi.ToOutputWithContext(ctx, i).(SnmpTrapsMapOutput)
}
type SnmpTrapsOutput struct{ *pulumi.OutputState }
func (SnmpTrapsOutput) ElementType() reflect.Type {
return reflect.TypeOf((**SnmpTraps)(nil)).Elem()
}
func (o SnmpTrapsOutput) ToSnmpTrapsOutput() SnmpTrapsOutput {
return o
}
func (o SnmpTrapsOutput) ToSnmpTrapsOutputWithContext(ctx context.Context) SnmpTrapsOutput {
return o
}
// Encrypted password
func (o SnmpTrapsOutput) AuthPasswordencrypted() pulumi.StringPtrOutput {
return o.ApplyT(func(v *SnmpTraps) pulumi.StringPtrOutput { return v.AuthPasswordencrypted }).(pulumi.StringPtrOutput)
}
// Specifies the protocol used to authenticate the user.
func (o SnmpTrapsOutput) AuthProtocol() pulumi.StringPtrOutput {
return o.ApplyT(func(v *SnmpTraps) pulumi.StringPtrOutput { return v.AuthProtocol }).(pulumi.StringPtrOutput)
}
// Specifies the community string used for this trap.
func (o SnmpTrapsOutput) Community() pulumi.StringPtrOutput {
return o.ApplyT(func(v *SnmpTraps) pulumi.StringPtrOutput { return v.Community }).(pulumi.StringPtrOutput)
}
// The port that the trap will be sent to.
func (o SnmpTrapsOutput) Description() pulumi.StringPtrOutput {
return o.ApplyT(func(v *SnmpTraps) pulumi.StringPtrOutput { return v.Description }).(pulumi.StringPtrOutput)
}
// Specifies the authoritative security engine for SNMPv3.
func (o SnmpTrapsOutput) EngineId() pulumi.StringPtrOutput {
return o.ApplyT(func(v *SnmpTraps) pulumi.StringPtrOutput { return v.EngineId }).(pulumi.StringPtrOutput)
}
// The host the trap will be sent to.
func (o SnmpTrapsOutput) Host() pulumi.StringPtrOutput {
return o.ApplyT(func(v *SnmpTraps) pulumi.StringPtrOutput { return v.Host }).(pulumi.StringPtrOutput)
}
// Name of the snmp trap.
func (o SnmpTrapsOutput) Name() pulumi.StringPtrOutput {
return o.ApplyT(func(v *SnmpTraps) pulumi.StringPtrOutput { return v.Name }).(pulumi.StringPtrOutput)
}
// User defined description.
func (o SnmpTrapsOutput) Port() pulumi.IntPtrOutput {
return o.ApplyT(func(v *SnmpTraps) pulumi.IntPtrOutput { return v.Port }).(pulumi.IntPtrOutput)
}
// Specifies the clear text password used to encrypt traffic. This field will not be displayed.
func (o SnmpTrapsOutput) PrivacyPassword() pulumi.StringPtrOutput {
return o.ApplyT(func(v *SnmpTraps) pulumi.StringPtrOutput { return v.PrivacyPassword }).(pulumi.StringPtrOutput)
}
// Specifies the encrypted password used to encrypt traffic.
func (o SnmpTrapsOutput) PrivacyPasswordEncrypted() pulumi.StringPtrOutput {
return o.ApplyT(func(v *SnmpTraps) pulumi.StringPtrOutput { return v.PrivacyPasswordEncrypted }).(pulumi.StringPtrOutput)
}
// Specifies the protocol used to encrypt traffic.
func (o SnmpTrapsOutput) PrivacyProtocol() pulumi.StringPtrOutput {
return o.ApplyT(func(v *SnmpTraps) pulumi.StringPtrOutput { return v.PrivacyProtocol }).(pulumi.StringPtrOutput)
}
// Specifies whether or not traffic is encrypted and whether or not authentication is required.
func (o SnmpTrapsOutput) SecurityLevel() pulumi.StringOutput {
return o.ApplyT(func(v *SnmpTraps) pulumi.StringOutput { return v.SecurityLevel }).(pulumi.StringOutput)
}
// Security name used in conjunction with SNMPv3.
func (o SnmpTrapsOutput) SecurityName() pulumi.StringPtrOutput {
return o.ApplyT(func(v *SnmpTraps) pulumi.StringPtrOutput { return v.SecurityName }).(pulumi.StringPtrOutput)
}
// SNMP version used for sending the trap.
func (o SnmpTrapsOutput) Version() pulumi.StringOutput {
return o.ApplyT(func(v *SnmpTraps) pulumi.StringOutput { return v.Version }).(pulumi.StringOutput)
}
type SnmpTrapsArrayOutput struct{ *pulumi.OutputState }
func (SnmpTrapsArrayOutput) ElementType() reflect.Type {
return reflect.TypeOf((*[]*SnmpTraps)(nil)).Elem()
}
func (o SnmpTrapsArrayOutput) ToSnmpTrapsArrayOutput() SnmpTrapsArrayOutput {
return o
}
func (o SnmpTrapsArrayOutput) ToSnmpTrapsArrayOutputWithContext(ctx context.Context) SnmpTrapsArrayOutput {
return o
}
func (o SnmpTrapsArrayOutput) Index(i pulumi.IntInput) SnmpTrapsOutput {
return pulumi.All(o, i).ApplyT(func(vs []interface{}) *SnmpTraps {
return vs[0].([]*SnmpTraps)[vs[1].(int)]
}).(SnmpTrapsOutput)
}
type SnmpTrapsMapOutput struct{ *pulumi.OutputState }
func (SnmpTrapsMapOutput) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*SnmpTraps)(nil)).Elem()
}
func (o SnmpTrapsMapOutput) ToSnmpTrapsMapOutput() SnmpTrapsMapOutput {
return o
}
func (o SnmpTrapsMapOutput) ToSnmpTrapsMapOutputWithContext(ctx context.Context) SnmpTrapsMapOutput {
return o
}
func (o SnmpTrapsMapOutput) MapIndex(k pulumi.StringInput) SnmpTrapsOutput {
return pulumi.All(o, k).ApplyT(func(vs []interface{}) *SnmpTraps {
return vs[0].(map[string]*SnmpTraps)[vs[1].(string)]
}).(SnmpTrapsOutput)
}
func init() {
pulumi.RegisterInputType(reflect.TypeOf((*SnmpTrapsInput)(nil)).Elem(), &SnmpTraps{})
pulumi.RegisterInputType(reflect.TypeOf((*SnmpTrapsArrayInput)(nil)).Elem(), SnmpTrapsArray{})
pulumi.RegisterInputType(reflect.TypeOf((*SnmpTrapsMapInput)(nil)).Elem(), SnmpTrapsMap{})
pulumi.RegisterOutputType(SnmpTrapsOutput{})
pulumi.RegisterOutputType(SnmpTrapsArrayOutput{})
pulumi.RegisterOutputType(SnmpTrapsMapOutput{})
}