/
appSecCustomRuleAction.go
270 lines (220 loc) · 10.9 KB
/
appSecCustomRuleAction.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
// 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 AppSecCustomRuleAction struct {
pulumi.CustomResourceState
// Unique identifier of the security configuration
ConfigId pulumi.IntOutput `pulumi:"configId"`
// Action to be taken when the custom rule is invoked
CustomRuleAction pulumi.StringOutput `pulumi:"customRuleAction"`
// Unique identifier of the custom rule whose action is being modified
CustomRuleId pulumi.IntOutput `pulumi:"customRuleId"`
// Unique identifier of the security policy
SecurityPolicyId pulumi.StringOutput `pulumi:"securityPolicyId"`
}
// NewAppSecCustomRuleAction registers a new resource with the given unique name, arguments, and options.
func NewAppSecCustomRuleAction(ctx *pulumi.Context,
name string, args *AppSecCustomRuleActionArgs, opts ...pulumi.ResourceOption) (*AppSecCustomRuleAction, 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.CustomRuleAction == nil {
return nil, errors.New("invalid value for required argument 'CustomRuleAction'")
}
if args.CustomRuleId == nil {
return nil, errors.New("invalid value for required argument 'CustomRuleId'")
}
if args.SecurityPolicyId == nil {
return nil, errors.New("invalid value for required argument 'SecurityPolicyId'")
}
var resource AppSecCustomRuleAction
err := ctx.RegisterResource("akamai:index/appSecCustomRuleAction:AppSecCustomRuleAction", name, args, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// GetAppSecCustomRuleAction gets an existing AppSecCustomRuleAction 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 GetAppSecCustomRuleAction(ctx *pulumi.Context,
name string, id pulumi.IDInput, state *AppSecCustomRuleActionState, opts ...pulumi.ResourceOption) (*AppSecCustomRuleAction, error) {
var resource AppSecCustomRuleAction
err := ctx.ReadResource("akamai:index/appSecCustomRuleAction:AppSecCustomRuleAction", name, id, state, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// Input properties used for looking up and filtering AppSecCustomRuleAction resources.
type appSecCustomRuleActionState struct {
// Unique identifier of the security configuration
ConfigId *int `pulumi:"configId"`
// Action to be taken when the custom rule is invoked
CustomRuleAction *string `pulumi:"customRuleAction"`
// Unique identifier of the custom rule whose action is being modified
CustomRuleId *int `pulumi:"customRuleId"`
// Unique identifier of the security policy
SecurityPolicyId *string `pulumi:"securityPolicyId"`
}
type AppSecCustomRuleActionState struct {
// Unique identifier of the security configuration
ConfigId pulumi.IntPtrInput
// Action to be taken when the custom rule is invoked
CustomRuleAction pulumi.StringPtrInput
// Unique identifier of the custom rule whose action is being modified
CustomRuleId pulumi.IntPtrInput
// Unique identifier of the security policy
SecurityPolicyId pulumi.StringPtrInput
}
func (AppSecCustomRuleActionState) ElementType() reflect.Type {
return reflect.TypeOf((*appSecCustomRuleActionState)(nil)).Elem()
}
type appSecCustomRuleActionArgs struct {
// Unique identifier of the security configuration
ConfigId int `pulumi:"configId"`
// Action to be taken when the custom rule is invoked
CustomRuleAction string `pulumi:"customRuleAction"`
// Unique identifier of the custom rule whose action is being modified
CustomRuleId int `pulumi:"customRuleId"`
// Unique identifier of the security policy
SecurityPolicyId string `pulumi:"securityPolicyId"`
}
// The set of arguments for constructing a AppSecCustomRuleAction resource.
type AppSecCustomRuleActionArgs struct {
// Unique identifier of the security configuration
ConfigId pulumi.IntInput
// Action to be taken when the custom rule is invoked
CustomRuleAction pulumi.StringInput
// Unique identifier of the custom rule whose action is being modified
CustomRuleId pulumi.IntInput
// Unique identifier of the security policy
SecurityPolicyId pulumi.StringInput
}
func (AppSecCustomRuleActionArgs) ElementType() reflect.Type {
return reflect.TypeOf((*appSecCustomRuleActionArgs)(nil)).Elem()
}
type AppSecCustomRuleActionInput interface {
pulumi.Input
ToAppSecCustomRuleActionOutput() AppSecCustomRuleActionOutput
ToAppSecCustomRuleActionOutputWithContext(ctx context.Context) AppSecCustomRuleActionOutput
}
func (*AppSecCustomRuleAction) ElementType() reflect.Type {
return reflect.TypeOf((**AppSecCustomRuleAction)(nil)).Elem()
}
func (i *AppSecCustomRuleAction) ToAppSecCustomRuleActionOutput() AppSecCustomRuleActionOutput {
return i.ToAppSecCustomRuleActionOutputWithContext(context.Background())
}
func (i *AppSecCustomRuleAction) ToAppSecCustomRuleActionOutputWithContext(ctx context.Context) AppSecCustomRuleActionOutput {
return pulumi.ToOutputWithContext(ctx, i).(AppSecCustomRuleActionOutput)
}
// AppSecCustomRuleActionArrayInput is an input type that accepts AppSecCustomRuleActionArray and AppSecCustomRuleActionArrayOutput values.
// You can construct a concrete instance of `AppSecCustomRuleActionArrayInput` via:
//
// AppSecCustomRuleActionArray{ AppSecCustomRuleActionArgs{...} }
type AppSecCustomRuleActionArrayInput interface {
pulumi.Input
ToAppSecCustomRuleActionArrayOutput() AppSecCustomRuleActionArrayOutput
ToAppSecCustomRuleActionArrayOutputWithContext(context.Context) AppSecCustomRuleActionArrayOutput
}
type AppSecCustomRuleActionArray []AppSecCustomRuleActionInput
func (AppSecCustomRuleActionArray) ElementType() reflect.Type {
return reflect.TypeOf((*[]*AppSecCustomRuleAction)(nil)).Elem()
}
func (i AppSecCustomRuleActionArray) ToAppSecCustomRuleActionArrayOutput() AppSecCustomRuleActionArrayOutput {
return i.ToAppSecCustomRuleActionArrayOutputWithContext(context.Background())
}
func (i AppSecCustomRuleActionArray) ToAppSecCustomRuleActionArrayOutputWithContext(ctx context.Context) AppSecCustomRuleActionArrayOutput {
return pulumi.ToOutputWithContext(ctx, i).(AppSecCustomRuleActionArrayOutput)
}
// AppSecCustomRuleActionMapInput is an input type that accepts AppSecCustomRuleActionMap and AppSecCustomRuleActionMapOutput values.
// You can construct a concrete instance of `AppSecCustomRuleActionMapInput` via:
//
// AppSecCustomRuleActionMap{ "key": AppSecCustomRuleActionArgs{...} }
type AppSecCustomRuleActionMapInput interface {
pulumi.Input
ToAppSecCustomRuleActionMapOutput() AppSecCustomRuleActionMapOutput
ToAppSecCustomRuleActionMapOutputWithContext(context.Context) AppSecCustomRuleActionMapOutput
}
type AppSecCustomRuleActionMap map[string]AppSecCustomRuleActionInput
func (AppSecCustomRuleActionMap) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*AppSecCustomRuleAction)(nil)).Elem()
}
func (i AppSecCustomRuleActionMap) ToAppSecCustomRuleActionMapOutput() AppSecCustomRuleActionMapOutput {
return i.ToAppSecCustomRuleActionMapOutputWithContext(context.Background())
}
func (i AppSecCustomRuleActionMap) ToAppSecCustomRuleActionMapOutputWithContext(ctx context.Context) AppSecCustomRuleActionMapOutput {
return pulumi.ToOutputWithContext(ctx, i).(AppSecCustomRuleActionMapOutput)
}
type AppSecCustomRuleActionOutput struct{ *pulumi.OutputState }
func (AppSecCustomRuleActionOutput) ElementType() reflect.Type {
return reflect.TypeOf((**AppSecCustomRuleAction)(nil)).Elem()
}
func (o AppSecCustomRuleActionOutput) ToAppSecCustomRuleActionOutput() AppSecCustomRuleActionOutput {
return o
}
func (o AppSecCustomRuleActionOutput) ToAppSecCustomRuleActionOutputWithContext(ctx context.Context) AppSecCustomRuleActionOutput {
return o
}
// Unique identifier of the security configuration
func (o AppSecCustomRuleActionOutput) ConfigId() pulumi.IntOutput {
return o.ApplyT(func(v *AppSecCustomRuleAction) pulumi.IntOutput { return v.ConfigId }).(pulumi.IntOutput)
}
// Action to be taken when the custom rule is invoked
func (o AppSecCustomRuleActionOutput) CustomRuleAction() pulumi.StringOutput {
return o.ApplyT(func(v *AppSecCustomRuleAction) pulumi.StringOutput { return v.CustomRuleAction }).(pulumi.StringOutput)
}
// Unique identifier of the custom rule whose action is being modified
func (o AppSecCustomRuleActionOutput) CustomRuleId() pulumi.IntOutput {
return o.ApplyT(func(v *AppSecCustomRuleAction) pulumi.IntOutput { return v.CustomRuleId }).(pulumi.IntOutput)
}
// Unique identifier of the security policy
func (o AppSecCustomRuleActionOutput) SecurityPolicyId() pulumi.StringOutput {
return o.ApplyT(func(v *AppSecCustomRuleAction) pulumi.StringOutput { return v.SecurityPolicyId }).(pulumi.StringOutput)
}
type AppSecCustomRuleActionArrayOutput struct{ *pulumi.OutputState }
func (AppSecCustomRuleActionArrayOutput) ElementType() reflect.Type {
return reflect.TypeOf((*[]*AppSecCustomRuleAction)(nil)).Elem()
}
func (o AppSecCustomRuleActionArrayOutput) ToAppSecCustomRuleActionArrayOutput() AppSecCustomRuleActionArrayOutput {
return o
}
func (o AppSecCustomRuleActionArrayOutput) ToAppSecCustomRuleActionArrayOutputWithContext(ctx context.Context) AppSecCustomRuleActionArrayOutput {
return o
}
func (o AppSecCustomRuleActionArrayOutput) Index(i pulumi.IntInput) AppSecCustomRuleActionOutput {
return pulumi.All(o, i).ApplyT(func(vs []interface{}) *AppSecCustomRuleAction {
return vs[0].([]*AppSecCustomRuleAction)[vs[1].(int)]
}).(AppSecCustomRuleActionOutput)
}
type AppSecCustomRuleActionMapOutput struct{ *pulumi.OutputState }
func (AppSecCustomRuleActionMapOutput) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*AppSecCustomRuleAction)(nil)).Elem()
}
func (o AppSecCustomRuleActionMapOutput) ToAppSecCustomRuleActionMapOutput() AppSecCustomRuleActionMapOutput {
return o
}
func (o AppSecCustomRuleActionMapOutput) ToAppSecCustomRuleActionMapOutputWithContext(ctx context.Context) AppSecCustomRuleActionMapOutput {
return o
}
func (o AppSecCustomRuleActionMapOutput) MapIndex(k pulumi.StringInput) AppSecCustomRuleActionOutput {
return pulumi.All(o, k).ApplyT(func(vs []interface{}) *AppSecCustomRuleAction {
return vs[0].(map[string]*AppSecCustomRuleAction)[vs[1].(string)]
}).(AppSecCustomRuleActionOutput)
}
func init() {
pulumi.RegisterInputType(reflect.TypeOf((*AppSecCustomRuleActionInput)(nil)).Elem(), &AppSecCustomRuleAction{})
pulumi.RegisterInputType(reflect.TypeOf((*AppSecCustomRuleActionArrayInput)(nil)).Elem(), AppSecCustomRuleActionArray{})
pulumi.RegisterInputType(reflect.TypeOf((*AppSecCustomRuleActionMapInput)(nil)).Elem(), AppSecCustomRuleActionMap{})
pulumi.RegisterOutputType(AppSecCustomRuleActionOutput{})
pulumi.RegisterOutputType(AppSecCustomRuleActionArrayOutput{})
pulumi.RegisterOutputType(AppSecCustomRuleActionMapOutput{})
}