/
appSecIPGeo.go
297 lines (245 loc) · 10.6 KB
/
appSecIPGeo.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
// 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 AppSecIPGeo struct {
pulumi.CustomResourceState
// Unique identifier of the security configuration
ConfigId pulumi.IntOutput `pulumi:"configId"`
// List of IDs of network list that are always allowed
ExceptionIpNetworkLists pulumi.StringArrayOutput `pulumi:"exceptionIpNetworkLists"`
// List of IDs of geographic network list to be blocked
GeoNetworkLists pulumi.StringArrayOutput `pulumi:"geoNetworkLists"`
// List of IDs of IP network list to be blocked
IpNetworkLists pulumi.StringArrayOutput `pulumi:"ipNetworkLists"`
// Protection mode (block or allow)
Mode pulumi.StringOutput `pulumi:"mode"`
// Unique identifier of the security policy
SecurityPolicyId pulumi.StringOutput `pulumi:"securityPolicyId"`
}
// NewAppSecIPGeo registers a new resource with the given unique name, arguments, and options.
func NewAppSecIPGeo(ctx *pulumi.Context,
name string, args *AppSecIPGeoArgs, opts ...pulumi.ResourceOption) (*AppSecIPGeo, 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.Mode == nil {
return nil, errors.New("invalid value for required argument 'Mode'")
}
if args.SecurityPolicyId == nil {
return nil, errors.New("invalid value for required argument 'SecurityPolicyId'")
}
var resource AppSecIPGeo
err := ctx.RegisterResource("akamai:index/appSecIPGeo:AppSecIPGeo", name, args, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// GetAppSecIPGeo gets an existing AppSecIPGeo 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 GetAppSecIPGeo(ctx *pulumi.Context,
name string, id pulumi.IDInput, state *AppSecIPGeoState, opts ...pulumi.ResourceOption) (*AppSecIPGeo, error) {
var resource AppSecIPGeo
err := ctx.ReadResource("akamai:index/appSecIPGeo:AppSecIPGeo", name, id, state, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// Input properties used for looking up and filtering AppSecIPGeo resources.
type appSecIPGeoState struct {
// Unique identifier of the security configuration
ConfigId *int `pulumi:"configId"`
// List of IDs of network list that are always allowed
ExceptionIpNetworkLists []string `pulumi:"exceptionIpNetworkLists"`
// List of IDs of geographic network list to be blocked
GeoNetworkLists []string `pulumi:"geoNetworkLists"`
// List of IDs of IP network list to be blocked
IpNetworkLists []string `pulumi:"ipNetworkLists"`
// Protection mode (block or allow)
Mode *string `pulumi:"mode"`
// Unique identifier of the security policy
SecurityPolicyId *string `pulumi:"securityPolicyId"`
}
type AppSecIPGeoState struct {
// Unique identifier of the security configuration
ConfigId pulumi.IntPtrInput
// List of IDs of network list that are always allowed
ExceptionIpNetworkLists pulumi.StringArrayInput
// List of IDs of geographic network list to be blocked
GeoNetworkLists pulumi.StringArrayInput
// List of IDs of IP network list to be blocked
IpNetworkLists pulumi.StringArrayInput
// Protection mode (block or allow)
Mode pulumi.StringPtrInput
// Unique identifier of the security policy
SecurityPolicyId pulumi.StringPtrInput
}
func (AppSecIPGeoState) ElementType() reflect.Type {
return reflect.TypeOf((*appSecIPGeoState)(nil)).Elem()
}
type appSecIPGeoArgs struct {
// Unique identifier of the security configuration
ConfigId int `pulumi:"configId"`
// List of IDs of network list that are always allowed
ExceptionIpNetworkLists []string `pulumi:"exceptionIpNetworkLists"`
// List of IDs of geographic network list to be blocked
GeoNetworkLists []string `pulumi:"geoNetworkLists"`
// List of IDs of IP network list to be blocked
IpNetworkLists []string `pulumi:"ipNetworkLists"`
// Protection mode (block or allow)
Mode string `pulumi:"mode"`
// Unique identifier of the security policy
SecurityPolicyId string `pulumi:"securityPolicyId"`
}
// The set of arguments for constructing a AppSecIPGeo resource.
type AppSecIPGeoArgs struct {
// Unique identifier of the security configuration
ConfigId pulumi.IntInput
// List of IDs of network list that are always allowed
ExceptionIpNetworkLists pulumi.StringArrayInput
// List of IDs of geographic network list to be blocked
GeoNetworkLists pulumi.StringArrayInput
// List of IDs of IP network list to be blocked
IpNetworkLists pulumi.StringArrayInput
// Protection mode (block or allow)
Mode pulumi.StringInput
// Unique identifier of the security policy
SecurityPolicyId pulumi.StringInput
}
func (AppSecIPGeoArgs) ElementType() reflect.Type {
return reflect.TypeOf((*appSecIPGeoArgs)(nil)).Elem()
}
type AppSecIPGeoInput interface {
pulumi.Input
ToAppSecIPGeoOutput() AppSecIPGeoOutput
ToAppSecIPGeoOutputWithContext(ctx context.Context) AppSecIPGeoOutput
}
func (*AppSecIPGeo) ElementType() reflect.Type {
return reflect.TypeOf((**AppSecIPGeo)(nil)).Elem()
}
func (i *AppSecIPGeo) ToAppSecIPGeoOutput() AppSecIPGeoOutput {
return i.ToAppSecIPGeoOutputWithContext(context.Background())
}
func (i *AppSecIPGeo) ToAppSecIPGeoOutputWithContext(ctx context.Context) AppSecIPGeoOutput {
return pulumi.ToOutputWithContext(ctx, i).(AppSecIPGeoOutput)
}
// AppSecIPGeoArrayInput is an input type that accepts AppSecIPGeoArray and AppSecIPGeoArrayOutput values.
// You can construct a concrete instance of `AppSecIPGeoArrayInput` via:
//
// AppSecIPGeoArray{ AppSecIPGeoArgs{...} }
type AppSecIPGeoArrayInput interface {
pulumi.Input
ToAppSecIPGeoArrayOutput() AppSecIPGeoArrayOutput
ToAppSecIPGeoArrayOutputWithContext(context.Context) AppSecIPGeoArrayOutput
}
type AppSecIPGeoArray []AppSecIPGeoInput
func (AppSecIPGeoArray) ElementType() reflect.Type {
return reflect.TypeOf((*[]*AppSecIPGeo)(nil)).Elem()
}
func (i AppSecIPGeoArray) ToAppSecIPGeoArrayOutput() AppSecIPGeoArrayOutput {
return i.ToAppSecIPGeoArrayOutputWithContext(context.Background())
}
func (i AppSecIPGeoArray) ToAppSecIPGeoArrayOutputWithContext(ctx context.Context) AppSecIPGeoArrayOutput {
return pulumi.ToOutputWithContext(ctx, i).(AppSecIPGeoArrayOutput)
}
// AppSecIPGeoMapInput is an input type that accepts AppSecIPGeoMap and AppSecIPGeoMapOutput values.
// You can construct a concrete instance of `AppSecIPGeoMapInput` via:
//
// AppSecIPGeoMap{ "key": AppSecIPGeoArgs{...} }
type AppSecIPGeoMapInput interface {
pulumi.Input
ToAppSecIPGeoMapOutput() AppSecIPGeoMapOutput
ToAppSecIPGeoMapOutputWithContext(context.Context) AppSecIPGeoMapOutput
}
type AppSecIPGeoMap map[string]AppSecIPGeoInput
func (AppSecIPGeoMap) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*AppSecIPGeo)(nil)).Elem()
}
func (i AppSecIPGeoMap) ToAppSecIPGeoMapOutput() AppSecIPGeoMapOutput {
return i.ToAppSecIPGeoMapOutputWithContext(context.Background())
}
func (i AppSecIPGeoMap) ToAppSecIPGeoMapOutputWithContext(ctx context.Context) AppSecIPGeoMapOutput {
return pulumi.ToOutputWithContext(ctx, i).(AppSecIPGeoMapOutput)
}
type AppSecIPGeoOutput struct{ *pulumi.OutputState }
func (AppSecIPGeoOutput) ElementType() reflect.Type {
return reflect.TypeOf((**AppSecIPGeo)(nil)).Elem()
}
func (o AppSecIPGeoOutput) ToAppSecIPGeoOutput() AppSecIPGeoOutput {
return o
}
func (o AppSecIPGeoOutput) ToAppSecIPGeoOutputWithContext(ctx context.Context) AppSecIPGeoOutput {
return o
}
// Unique identifier of the security configuration
func (o AppSecIPGeoOutput) ConfigId() pulumi.IntOutput {
return o.ApplyT(func(v *AppSecIPGeo) pulumi.IntOutput { return v.ConfigId }).(pulumi.IntOutput)
}
// List of IDs of network list that are always allowed
func (o AppSecIPGeoOutput) ExceptionIpNetworkLists() pulumi.StringArrayOutput {
return o.ApplyT(func(v *AppSecIPGeo) pulumi.StringArrayOutput { return v.ExceptionIpNetworkLists }).(pulumi.StringArrayOutput)
}
// List of IDs of geographic network list to be blocked
func (o AppSecIPGeoOutput) GeoNetworkLists() pulumi.StringArrayOutput {
return o.ApplyT(func(v *AppSecIPGeo) pulumi.StringArrayOutput { return v.GeoNetworkLists }).(pulumi.StringArrayOutput)
}
// List of IDs of IP network list to be blocked
func (o AppSecIPGeoOutput) IpNetworkLists() pulumi.StringArrayOutput {
return o.ApplyT(func(v *AppSecIPGeo) pulumi.StringArrayOutput { return v.IpNetworkLists }).(pulumi.StringArrayOutput)
}
// Protection mode (block or allow)
func (o AppSecIPGeoOutput) Mode() pulumi.StringOutput {
return o.ApplyT(func(v *AppSecIPGeo) pulumi.StringOutput { return v.Mode }).(pulumi.StringOutput)
}
// Unique identifier of the security policy
func (o AppSecIPGeoOutput) SecurityPolicyId() pulumi.StringOutput {
return o.ApplyT(func(v *AppSecIPGeo) pulumi.StringOutput { return v.SecurityPolicyId }).(pulumi.StringOutput)
}
type AppSecIPGeoArrayOutput struct{ *pulumi.OutputState }
func (AppSecIPGeoArrayOutput) ElementType() reflect.Type {
return reflect.TypeOf((*[]*AppSecIPGeo)(nil)).Elem()
}
func (o AppSecIPGeoArrayOutput) ToAppSecIPGeoArrayOutput() AppSecIPGeoArrayOutput {
return o
}
func (o AppSecIPGeoArrayOutput) ToAppSecIPGeoArrayOutputWithContext(ctx context.Context) AppSecIPGeoArrayOutput {
return o
}
func (o AppSecIPGeoArrayOutput) Index(i pulumi.IntInput) AppSecIPGeoOutput {
return pulumi.All(o, i).ApplyT(func(vs []interface{}) *AppSecIPGeo {
return vs[0].([]*AppSecIPGeo)[vs[1].(int)]
}).(AppSecIPGeoOutput)
}
type AppSecIPGeoMapOutput struct{ *pulumi.OutputState }
func (AppSecIPGeoMapOutput) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*AppSecIPGeo)(nil)).Elem()
}
func (o AppSecIPGeoMapOutput) ToAppSecIPGeoMapOutput() AppSecIPGeoMapOutput {
return o
}
func (o AppSecIPGeoMapOutput) ToAppSecIPGeoMapOutputWithContext(ctx context.Context) AppSecIPGeoMapOutput {
return o
}
func (o AppSecIPGeoMapOutput) MapIndex(k pulumi.StringInput) AppSecIPGeoOutput {
return pulumi.All(o, k).ApplyT(func(vs []interface{}) *AppSecIPGeo {
return vs[0].(map[string]*AppSecIPGeo)[vs[1].(string)]
}).(AppSecIPGeoOutput)
}
func init() {
pulumi.RegisterInputType(reflect.TypeOf((*AppSecIPGeoInput)(nil)).Elem(), &AppSecIPGeo{})
pulumi.RegisterInputType(reflect.TypeOf((*AppSecIPGeoArrayInput)(nil)).Elem(), AppSecIPGeoArray{})
pulumi.RegisterInputType(reflect.TypeOf((*AppSecIPGeoMapInput)(nil)).Elem(), AppSecIPGeoMap{})
pulumi.RegisterOutputType(AppSecIPGeoOutput{})
pulumi.RegisterOutputType(AppSecIPGeoArrayOutput{})
pulumi.RegisterOutputType(AppSecIPGeoMapOutput{})
}