/
appSecEvalRule.go
285 lines (234 loc) · 10.6 KB
/
appSecEvalRule.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
// 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"
"errors"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
type AppSecEvalRule struct {
pulumi.CustomResourceState
// JSON-formatted condition and exception information for the evaluation rule
ConditionException pulumi.StringPtrOutput `pulumi:"conditionException"`
// Unique identifier of the security configuration
ConfigId pulumi.IntOutput `pulumi:"configId"`
// Action to be taken when the evaluation rule is triggered
RuleAction pulumi.StringOutput `pulumi:"ruleAction"`
// Unique identifier of the evaluation rule being modified
RuleId pulumi.IntOutput `pulumi:"ruleId"`
// Unique identifier of the security policy
SecurityPolicyId pulumi.StringOutput `pulumi:"securityPolicyId"`
}
// NewAppSecEvalRule registers a new resource with the given unique name, arguments, and options.
func NewAppSecEvalRule(ctx *pulumi.Context,
name string, args *AppSecEvalRuleArgs, opts ...pulumi.ResourceOption) (*AppSecEvalRule, error) {
if args == nil {
return nil, errors.New("missing one or more required arguments")
}
if args.ConfigId == nil {
return nil, errors.New("invalid value for required argument 'ConfigId'")
}
if args.RuleAction == nil {
return nil, errors.New("invalid value for required argument 'RuleAction'")
}
if args.RuleId == nil {
return nil, errors.New("invalid value for required argument 'RuleId'")
}
if args.SecurityPolicyId == nil {
return nil, errors.New("invalid value for required argument 'SecurityPolicyId'")
}
var resource AppSecEvalRule
err := ctx.RegisterResource("akamai:index/appSecEvalRule:AppSecEvalRule", name, args, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// GetAppSecEvalRule gets an existing AppSecEvalRule 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 GetAppSecEvalRule(ctx *pulumi.Context,
name string, id pulumi.IDInput, state *AppSecEvalRuleState, opts ...pulumi.ResourceOption) (*AppSecEvalRule, error) {
var resource AppSecEvalRule
err := ctx.ReadResource("akamai:index/appSecEvalRule:AppSecEvalRule", name, id, state, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// Input properties used for looking up and filtering AppSecEvalRule resources.
type appSecEvalRuleState struct {
// JSON-formatted condition and exception information for the evaluation rule
ConditionException *string `pulumi:"conditionException"`
// Unique identifier of the security configuration
ConfigId *int `pulumi:"configId"`
// Action to be taken when the evaluation rule is triggered
RuleAction *string `pulumi:"ruleAction"`
// Unique identifier of the evaluation rule being modified
RuleId *int `pulumi:"ruleId"`
// Unique identifier of the security policy
SecurityPolicyId *string `pulumi:"securityPolicyId"`
}
type AppSecEvalRuleState struct {
// JSON-formatted condition and exception information for the evaluation rule
ConditionException pulumi.StringPtrInput
// Unique identifier of the security configuration
ConfigId pulumi.IntPtrInput
// Action to be taken when the evaluation rule is triggered
RuleAction pulumi.StringPtrInput
// Unique identifier of the evaluation rule being modified
RuleId pulumi.IntPtrInput
// Unique identifier of the security policy
SecurityPolicyId pulumi.StringPtrInput
}
func (AppSecEvalRuleState) ElementType() reflect.Type {
return reflect.TypeOf((*appSecEvalRuleState)(nil)).Elem()
}
type appSecEvalRuleArgs struct {
// JSON-formatted condition and exception information for the evaluation rule
ConditionException *string `pulumi:"conditionException"`
// Unique identifier of the security configuration
ConfigId int `pulumi:"configId"`
// Action to be taken when the evaluation rule is triggered
RuleAction string `pulumi:"ruleAction"`
// Unique identifier of the evaluation rule being modified
RuleId int `pulumi:"ruleId"`
// Unique identifier of the security policy
SecurityPolicyId string `pulumi:"securityPolicyId"`
}
// The set of arguments for constructing a AppSecEvalRule resource.
type AppSecEvalRuleArgs struct {
// JSON-formatted condition and exception information for the evaluation rule
ConditionException pulumi.StringPtrInput
// Unique identifier of the security configuration
ConfigId pulumi.IntInput
// Action to be taken when the evaluation rule is triggered
RuleAction pulumi.StringInput
// Unique identifier of the evaluation rule being modified
RuleId pulumi.IntInput
// Unique identifier of the security policy
SecurityPolicyId pulumi.StringInput
}
func (AppSecEvalRuleArgs) ElementType() reflect.Type {
return reflect.TypeOf((*appSecEvalRuleArgs)(nil)).Elem()
}
type AppSecEvalRuleInput interface {
pulumi.Input
ToAppSecEvalRuleOutput() AppSecEvalRuleOutput
ToAppSecEvalRuleOutputWithContext(ctx context.Context) AppSecEvalRuleOutput
}
func (*AppSecEvalRule) ElementType() reflect.Type {
return reflect.TypeOf((**AppSecEvalRule)(nil)).Elem()
}
func (i *AppSecEvalRule) ToAppSecEvalRuleOutput() AppSecEvalRuleOutput {
return i.ToAppSecEvalRuleOutputWithContext(context.Background())
}
func (i *AppSecEvalRule) ToAppSecEvalRuleOutputWithContext(ctx context.Context) AppSecEvalRuleOutput {
return pulumi.ToOutputWithContext(ctx, i).(AppSecEvalRuleOutput)
}
// AppSecEvalRuleArrayInput is an input type that accepts AppSecEvalRuleArray and AppSecEvalRuleArrayOutput values.
// You can construct a concrete instance of `AppSecEvalRuleArrayInput` via:
//
// AppSecEvalRuleArray{ AppSecEvalRuleArgs{...} }
type AppSecEvalRuleArrayInput interface {
pulumi.Input
ToAppSecEvalRuleArrayOutput() AppSecEvalRuleArrayOutput
ToAppSecEvalRuleArrayOutputWithContext(context.Context) AppSecEvalRuleArrayOutput
}
type AppSecEvalRuleArray []AppSecEvalRuleInput
func (AppSecEvalRuleArray) ElementType() reflect.Type {
return reflect.TypeOf((*[]*AppSecEvalRule)(nil)).Elem()
}
func (i AppSecEvalRuleArray) ToAppSecEvalRuleArrayOutput() AppSecEvalRuleArrayOutput {
return i.ToAppSecEvalRuleArrayOutputWithContext(context.Background())
}
func (i AppSecEvalRuleArray) ToAppSecEvalRuleArrayOutputWithContext(ctx context.Context) AppSecEvalRuleArrayOutput {
return pulumi.ToOutputWithContext(ctx, i).(AppSecEvalRuleArrayOutput)
}
// AppSecEvalRuleMapInput is an input type that accepts AppSecEvalRuleMap and AppSecEvalRuleMapOutput values.
// You can construct a concrete instance of `AppSecEvalRuleMapInput` via:
//
// AppSecEvalRuleMap{ "key": AppSecEvalRuleArgs{...} }
type AppSecEvalRuleMapInput interface {
pulumi.Input
ToAppSecEvalRuleMapOutput() AppSecEvalRuleMapOutput
ToAppSecEvalRuleMapOutputWithContext(context.Context) AppSecEvalRuleMapOutput
}
type AppSecEvalRuleMap map[string]AppSecEvalRuleInput
func (AppSecEvalRuleMap) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*AppSecEvalRule)(nil)).Elem()
}
func (i AppSecEvalRuleMap) ToAppSecEvalRuleMapOutput() AppSecEvalRuleMapOutput {
return i.ToAppSecEvalRuleMapOutputWithContext(context.Background())
}
func (i AppSecEvalRuleMap) ToAppSecEvalRuleMapOutputWithContext(ctx context.Context) AppSecEvalRuleMapOutput {
return pulumi.ToOutputWithContext(ctx, i).(AppSecEvalRuleMapOutput)
}
type AppSecEvalRuleOutput struct{ *pulumi.OutputState }
func (AppSecEvalRuleOutput) ElementType() reflect.Type {
return reflect.TypeOf((**AppSecEvalRule)(nil)).Elem()
}
func (o AppSecEvalRuleOutput) ToAppSecEvalRuleOutput() AppSecEvalRuleOutput {
return o
}
func (o AppSecEvalRuleOutput) ToAppSecEvalRuleOutputWithContext(ctx context.Context) AppSecEvalRuleOutput {
return o
}
// JSON-formatted condition and exception information for the evaluation rule
func (o AppSecEvalRuleOutput) ConditionException() pulumi.StringPtrOutput {
return o.ApplyT(func(v *AppSecEvalRule) pulumi.StringPtrOutput { return v.ConditionException }).(pulumi.StringPtrOutput)
}
// Unique identifier of the security configuration
func (o AppSecEvalRuleOutput) ConfigId() pulumi.IntOutput {
return o.ApplyT(func(v *AppSecEvalRule) pulumi.IntOutput { return v.ConfigId }).(pulumi.IntOutput)
}
// Action to be taken when the evaluation rule is triggered
func (o AppSecEvalRuleOutput) RuleAction() pulumi.StringOutput {
return o.ApplyT(func(v *AppSecEvalRule) pulumi.StringOutput { return v.RuleAction }).(pulumi.StringOutput)
}
// Unique identifier of the evaluation rule being modified
func (o AppSecEvalRuleOutput) RuleId() pulumi.IntOutput {
return o.ApplyT(func(v *AppSecEvalRule) pulumi.IntOutput { return v.RuleId }).(pulumi.IntOutput)
}
// Unique identifier of the security policy
func (o AppSecEvalRuleOutput) SecurityPolicyId() pulumi.StringOutput {
return o.ApplyT(func(v *AppSecEvalRule) pulumi.StringOutput { return v.SecurityPolicyId }).(pulumi.StringOutput)
}
type AppSecEvalRuleArrayOutput struct{ *pulumi.OutputState }
func (AppSecEvalRuleArrayOutput) ElementType() reflect.Type {
return reflect.TypeOf((*[]*AppSecEvalRule)(nil)).Elem()
}
func (o AppSecEvalRuleArrayOutput) ToAppSecEvalRuleArrayOutput() AppSecEvalRuleArrayOutput {
return o
}
func (o AppSecEvalRuleArrayOutput) ToAppSecEvalRuleArrayOutputWithContext(ctx context.Context) AppSecEvalRuleArrayOutput {
return o
}
func (o AppSecEvalRuleArrayOutput) Index(i pulumi.IntInput) AppSecEvalRuleOutput {
return pulumi.All(o, i).ApplyT(func(vs []interface{}) *AppSecEvalRule {
return vs[0].([]*AppSecEvalRule)[vs[1].(int)]
}).(AppSecEvalRuleOutput)
}
type AppSecEvalRuleMapOutput struct{ *pulumi.OutputState }
func (AppSecEvalRuleMapOutput) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*AppSecEvalRule)(nil)).Elem()
}
func (o AppSecEvalRuleMapOutput) ToAppSecEvalRuleMapOutput() AppSecEvalRuleMapOutput {
return o
}
func (o AppSecEvalRuleMapOutput) ToAppSecEvalRuleMapOutputWithContext(ctx context.Context) AppSecEvalRuleMapOutput {
return o
}
func (o AppSecEvalRuleMapOutput) MapIndex(k pulumi.StringInput) AppSecEvalRuleOutput {
return pulumi.All(o, k).ApplyT(func(vs []interface{}) *AppSecEvalRule {
return vs[0].(map[string]*AppSecEvalRule)[vs[1].(string)]
}).(AppSecEvalRuleOutput)
}
func init() {
pulumi.RegisterInputType(reflect.TypeOf((*AppSecEvalRuleInput)(nil)).Elem(), &AppSecEvalRule{})
pulumi.RegisterInputType(reflect.TypeOf((*AppSecEvalRuleArrayInput)(nil)).Elem(), AppSecEvalRuleArray{})
pulumi.RegisterInputType(reflect.TypeOf((*AppSecEvalRuleMapInput)(nil)).Elem(), AppSecEvalRuleMap{})
pulumi.RegisterOutputType(AppSecEvalRuleOutput{})
pulumi.RegisterOutputType(AppSecEvalRuleArrayOutput{})
pulumi.RegisterOutputType(AppSecEvalRuleMapOutput{})
}