/
appSecEvalGroup.go
363 lines (312 loc) · 14.2 KB
/
appSecEvalGroup.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
// 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 akamai
import (
"context"
"reflect"
"github.com/pkg/errors"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
// **Scopes**: Evaluation attack group
//
// Modifies the action and the conditions and exceptions for an evaluation mode attack group.
//
// Note that this resource is only available to organizations running the Adaptive Security Engine (ASE) beta. For more information about ASE, please contact your Akamai representative.
//
// ## Example Usage
//
// Basic usage:
//
// ```go
// package main
//
// import (
//
// "fmt"
// "io/ioutil"
//
// "github.com/pulumi/pulumi-akamai/sdk/v3/go/akamai"
// "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
//
// )
//
// func readFileOrPanic(path string) pulumi.StringPtrInput {
// data, err := ioutil.ReadFile(path)
// if err != nil {
// panic(err.Error())
// }
// return pulumi.String(string(data))
// }
//
// func main() {
// pulumi.Run(func(ctx *pulumi.Context) error {
// configuration, err := akamai.LookupAppSecConfiguration(ctx, &GetAppSecConfigurationArgs{
// Name: pulumi.StringRef("Documentation"),
// }, nil)
// if err != nil {
// return err
// }
// _, err = akamai.NewAppSecEvalGroup(ctx, "evalAttackGroup", &akamai.AppSecEvalGroupArgs{
// ConfigId: pulumi.Int(configuration.ConfigId),
// SecurityPolicyId: pulumi.String("gms1_134637"),
// AttackGroup: pulumi.String("SQL"),
// AttackGroupAction: pulumi.String("deny"),
// ConditionException: readFileOrPanic(fmt.Sprintf("%v/condition_exception.json", path.Module)),
// })
// if err != nil {
// return err
// }
// return nil
// })
// }
//
// ```
type AppSecEvalGroup struct {
pulumi.CustomResourceState
// . Unique identifier of the evaluation attack group being modified.
AttackGroup pulumi.StringOutput `pulumi:"attackGroup"`
// . Action to be taken any time the attack group is triggered. Allowed values are:
// - **alert**. Record the event.
// - **deny**. Block the request.
// - **deny_custom_{custom_deny_id}**. Take the action specified by the custom deny.
// - **none**. Take no action.
AttackGroupAction pulumi.StringOutput `pulumi:"attackGroupAction"`
// . Path to a JSON file containing properties and property values for the attack group.
ConditionException pulumi.StringPtrOutput `pulumi:"conditionException"`
// . Unique identifier of the security configuration where evaluation is taking place.
ConfigId pulumi.IntOutput `pulumi:"configId"`
// . Unique identifier of the security policy associated with the evaluation process.
SecurityPolicyId pulumi.StringOutput `pulumi:"securityPolicyId"`
}
// NewAppSecEvalGroup registers a new resource with the given unique name, arguments, and options.
func NewAppSecEvalGroup(ctx *pulumi.Context,
name string, args *AppSecEvalGroupArgs, opts ...pulumi.ResourceOption) (*AppSecEvalGroup, error) {
if args == nil {
return nil, errors.New("missing one or more required arguments")
}
if args.AttackGroup == nil {
return nil, errors.New("invalid value for required argument 'AttackGroup'")
}
if args.AttackGroupAction == nil {
return nil, errors.New("invalid value for required argument 'AttackGroupAction'")
}
if args.ConfigId == nil {
return nil, errors.New("invalid value for required argument 'ConfigId'")
}
if args.SecurityPolicyId == nil {
return nil, errors.New("invalid value for required argument 'SecurityPolicyId'")
}
var resource AppSecEvalGroup
err := ctx.RegisterResource("akamai:index/appSecEvalGroup:AppSecEvalGroup", name, args, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// GetAppSecEvalGroup gets an existing AppSecEvalGroup 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 GetAppSecEvalGroup(ctx *pulumi.Context,
name string, id pulumi.IDInput, state *AppSecEvalGroupState, opts ...pulumi.ResourceOption) (*AppSecEvalGroup, error) {
var resource AppSecEvalGroup
err := ctx.ReadResource("akamai:index/appSecEvalGroup:AppSecEvalGroup", name, id, state, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// Input properties used for looking up and filtering AppSecEvalGroup resources.
type appSecEvalGroupState struct {
// . Unique identifier of the evaluation attack group being modified.
AttackGroup *string `pulumi:"attackGroup"`
// . Action to be taken any time the attack group is triggered. Allowed values are:
// - **alert**. Record the event.
// - **deny**. Block the request.
// - **deny_custom_{custom_deny_id}**. Take the action specified by the custom deny.
// - **none**. Take no action.
AttackGroupAction *string `pulumi:"attackGroupAction"`
// . Path to a JSON file containing properties and property values for the attack group.
ConditionException *string `pulumi:"conditionException"`
// . Unique identifier of the security configuration where evaluation is taking place.
ConfigId *int `pulumi:"configId"`
// . Unique identifier of the security policy associated with the evaluation process.
SecurityPolicyId *string `pulumi:"securityPolicyId"`
}
type AppSecEvalGroupState struct {
// . Unique identifier of the evaluation attack group being modified.
AttackGroup pulumi.StringPtrInput
// . Action to be taken any time the attack group is triggered. Allowed values are:
// - **alert**. Record the event.
// - **deny**. Block the request.
// - **deny_custom_{custom_deny_id}**. Take the action specified by the custom deny.
// - **none**. Take no action.
AttackGroupAction pulumi.StringPtrInput
// . Path to a JSON file containing properties and property values for the attack group.
ConditionException pulumi.StringPtrInput
// . Unique identifier of the security configuration where evaluation is taking place.
ConfigId pulumi.IntPtrInput
// . Unique identifier of the security policy associated with the evaluation process.
SecurityPolicyId pulumi.StringPtrInput
}
func (AppSecEvalGroupState) ElementType() reflect.Type {
return reflect.TypeOf((*appSecEvalGroupState)(nil)).Elem()
}
type appSecEvalGroupArgs struct {
// . Unique identifier of the evaluation attack group being modified.
AttackGroup string `pulumi:"attackGroup"`
// . Action to be taken any time the attack group is triggered. Allowed values are:
// - **alert**. Record the event.
// - **deny**. Block the request.
// - **deny_custom_{custom_deny_id}**. Take the action specified by the custom deny.
// - **none**. Take no action.
AttackGroupAction string `pulumi:"attackGroupAction"`
// . Path to a JSON file containing properties and property values for the attack group.
ConditionException *string `pulumi:"conditionException"`
// . Unique identifier of the security configuration where evaluation is taking place.
ConfigId int `pulumi:"configId"`
// . Unique identifier of the security policy associated with the evaluation process.
SecurityPolicyId string `pulumi:"securityPolicyId"`
}
// The set of arguments for constructing a AppSecEvalGroup resource.
type AppSecEvalGroupArgs struct {
// . Unique identifier of the evaluation attack group being modified.
AttackGroup pulumi.StringInput
// . Action to be taken any time the attack group is triggered. Allowed values are:
// - **alert**. Record the event.
// - **deny**. Block the request.
// - **deny_custom_{custom_deny_id}**. Take the action specified by the custom deny.
// - **none**. Take no action.
AttackGroupAction pulumi.StringInput
// . Path to a JSON file containing properties and property values for the attack group.
ConditionException pulumi.StringPtrInput
// . Unique identifier of the security configuration where evaluation is taking place.
ConfigId pulumi.IntInput
// . Unique identifier of the security policy associated with the evaluation process.
SecurityPolicyId pulumi.StringInput
}
func (AppSecEvalGroupArgs) ElementType() reflect.Type {
return reflect.TypeOf((*appSecEvalGroupArgs)(nil)).Elem()
}
type AppSecEvalGroupInput interface {
pulumi.Input
ToAppSecEvalGroupOutput() AppSecEvalGroupOutput
ToAppSecEvalGroupOutputWithContext(ctx context.Context) AppSecEvalGroupOutput
}
func (*AppSecEvalGroup) ElementType() reflect.Type {
return reflect.TypeOf((**AppSecEvalGroup)(nil)).Elem()
}
func (i *AppSecEvalGroup) ToAppSecEvalGroupOutput() AppSecEvalGroupOutput {
return i.ToAppSecEvalGroupOutputWithContext(context.Background())
}
func (i *AppSecEvalGroup) ToAppSecEvalGroupOutputWithContext(ctx context.Context) AppSecEvalGroupOutput {
return pulumi.ToOutputWithContext(ctx, i).(AppSecEvalGroupOutput)
}
// AppSecEvalGroupArrayInput is an input type that accepts AppSecEvalGroupArray and AppSecEvalGroupArrayOutput values.
// You can construct a concrete instance of `AppSecEvalGroupArrayInput` via:
//
// AppSecEvalGroupArray{ AppSecEvalGroupArgs{...} }
type AppSecEvalGroupArrayInput interface {
pulumi.Input
ToAppSecEvalGroupArrayOutput() AppSecEvalGroupArrayOutput
ToAppSecEvalGroupArrayOutputWithContext(context.Context) AppSecEvalGroupArrayOutput
}
type AppSecEvalGroupArray []AppSecEvalGroupInput
func (AppSecEvalGroupArray) ElementType() reflect.Type {
return reflect.TypeOf((*[]*AppSecEvalGroup)(nil)).Elem()
}
func (i AppSecEvalGroupArray) ToAppSecEvalGroupArrayOutput() AppSecEvalGroupArrayOutput {
return i.ToAppSecEvalGroupArrayOutputWithContext(context.Background())
}
func (i AppSecEvalGroupArray) ToAppSecEvalGroupArrayOutputWithContext(ctx context.Context) AppSecEvalGroupArrayOutput {
return pulumi.ToOutputWithContext(ctx, i).(AppSecEvalGroupArrayOutput)
}
// AppSecEvalGroupMapInput is an input type that accepts AppSecEvalGroupMap and AppSecEvalGroupMapOutput values.
// You can construct a concrete instance of `AppSecEvalGroupMapInput` via:
//
// AppSecEvalGroupMap{ "key": AppSecEvalGroupArgs{...} }
type AppSecEvalGroupMapInput interface {
pulumi.Input
ToAppSecEvalGroupMapOutput() AppSecEvalGroupMapOutput
ToAppSecEvalGroupMapOutputWithContext(context.Context) AppSecEvalGroupMapOutput
}
type AppSecEvalGroupMap map[string]AppSecEvalGroupInput
func (AppSecEvalGroupMap) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*AppSecEvalGroup)(nil)).Elem()
}
func (i AppSecEvalGroupMap) ToAppSecEvalGroupMapOutput() AppSecEvalGroupMapOutput {
return i.ToAppSecEvalGroupMapOutputWithContext(context.Background())
}
func (i AppSecEvalGroupMap) ToAppSecEvalGroupMapOutputWithContext(ctx context.Context) AppSecEvalGroupMapOutput {
return pulumi.ToOutputWithContext(ctx, i).(AppSecEvalGroupMapOutput)
}
type AppSecEvalGroupOutput struct{ *pulumi.OutputState }
func (AppSecEvalGroupOutput) ElementType() reflect.Type {
return reflect.TypeOf((**AppSecEvalGroup)(nil)).Elem()
}
func (o AppSecEvalGroupOutput) ToAppSecEvalGroupOutput() AppSecEvalGroupOutput {
return o
}
func (o AppSecEvalGroupOutput) ToAppSecEvalGroupOutputWithContext(ctx context.Context) AppSecEvalGroupOutput {
return o
}
// . Unique identifier of the evaluation attack group being modified.
func (o AppSecEvalGroupOutput) AttackGroup() pulumi.StringOutput {
return o.ApplyT(func(v *AppSecEvalGroup) pulumi.StringOutput { return v.AttackGroup }).(pulumi.StringOutput)
}
// . Action to be taken any time the attack group is triggered. Allowed values are:
// - **alert**. Record the event.
// - **deny**. Block the request.
// - **deny_custom_{custom_deny_id}**. Take the action specified by the custom deny.
// - **none**. Take no action.
func (o AppSecEvalGroupOutput) AttackGroupAction() pulumi.StringOutput {
return o.ApplyT(func(v *AppSecEvalGroup) pulumi.StringOutput { return v.AttackGroupAction }).(pulumi.StringOutput)
}
// . Path to a JSON file containing properties and property values for the attack group.
func (o AppSecEvalGroupOutput) ConditionException() pulumi.StringPtrOutput {
return o.ApplyT(func(v *AppSecEvalGroup) pulumi.StringPtrOutput { return v.ConditionException }).(pulumi.StringPtrOutput)
}
// . Unique identifier of the security configuration where evaluation is taking place.
func (o AppSecEvalGroupOutput) ConfigId() pulumi.IntOutput {
return o.ApplyT(func(v *AppSecEvalGroup) pulumi.IntOutput { return v.ConfigId }).(pulumi.IntOutput)
}
// . Unique identifier of the security policy associated with the evaluation process.
func (o AppSecEvalGroupOutput) SecurityPolicyId() pulumi.StringOutput {
return o.ApplyT(func(v *AppSecEvalGroup) pulumi.StringOutput { return v.SecurityPolicyId }).(pulumi.StringOutput)
}
type AppSecEvalGroupArrayOutput struct{ *pulumi.OutputState }
func (AppSecEvalGroupArrayOutput) ElementType() reflect.Type {
return reflect.TypeOf((*[]*AppSecEvalGroup)(nil)).Elem()
}
func (o AppSecEvalGroupArrayOutput) ToAppSecEvalGroupArrayOutput() AppSecEvalGroupArrayOutput {
return o
}
func (o AppSecEvalGroupArrayOutput) ToAppSecEvalGroupArrayOutputWithContext(ctx context.Context) AppSecEvalGroupArrayOutput {
return o
}
func (o AppSecEvalGroupArrayOutput) Index(i pulumi.IntInput) AppSecEvalGroupOutput {
return pulumi.All(o, i).ApplyT(func(vs []interface{}) *AppSecEvalGroup {
return vs[0].([]*AppSecEvalGroup)[vs[1].(int)]
}).(AppSecEvalGroupOutput)
}
type AppSecEvalGroupMapOutput struct{ *pulumi.OutputState }
func (AppSecEvalGroupMapOutput) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*AppSecEvalGroup)(nil)).Elem()
}
func (o AppSecEvalGroupMapOutput) ToAppSecEvalGroupMapOutput() AppSecEvalGroupMapOutput {
return o
}
func (o AppSecEvalGroupMapOutput) ToAppSecEvalGroupMapOutputWithContext(ctx context.Context) AppSecEvalGroupMapOutput {
return o
}
func (o AppSecEvalGroupMapOutput) MapIndex(k pulumi.StringInput) AppSecEvalGroupOutput {
return pulumi.All(o, k).ApplyT(func(vs []interface{}) *AppSecEvalGroup {
return vs[0].(map[string]*AppSecEvalGroup)[vs[1].(string)]
}).(AppSecEvalGroupOutput)
}
func init() {
pulumi.RegisterInputType(reflect.TypeOf((*AppSecEvalGroupInput)(nil)).Elem(), &AppSecEvalGroup{})
pulumi.RegisterInputType(reflect.TypeOf((*AppSecEvalGroupArrayInput)(nil)).Elem(), AppSecEvalGroupArray{})
pulumi.RegisterInputType(reflect.TypeOf((*AppSecEvalGroupMapInput)(nil)).Elem(), AppSecEvalGroupMap{})
pulumi.RegisterOutputType(AppSecEvalGroupOutput{})
pulumi.RegisterOutputType(AppSecEvalGroupArrayOutput{})
pulumi.RegisterOutputType(AppSecEvalGroupMapOutput{})
}