/
appSecIPGeoProtection.go
265 lines (215 loc) · 10.2 KB
/
appSecIPGeoProtection.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
// 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-akamai/sdk/v6/go/akamai/internal"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
type AppSecIPGeoProtection struct {
pulumi.CustomResourceState
// Unique identifier of the security configuration
ConfigId pulumi.IntOutput `pulumi:"configId"`
// Whether to enable IP/Geo protection
Enabled pulumi.BoolOutput `pulumi:"enabled"`
// Text representation
OutputText pulumi.StringOutput `pulumi:"outputText"`
// Unique identifier of the security policy
SecurityPolicyId pulumi.StringOutput `pulumi:"securityPolicyId"`
}
// NewAppSecIPGeoProtection registers a new resource with the given unique name, arguments, and options.
func NewAppSecIPGeoProtection(ctx *pulumi.Context,
name string, args *AppSecIPGeoProtectionArgs, opts ...pulumi.ResourceOption) (*AppSecIPGeoProtection, 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.Enabled == nil {
return nil, errors.New("invalid value for required argument 'Enabled'")
}
if args.SecurityPolicyId == nil {
return nil, errors.New("invalid value for required argument 'SecurityPolicyId'")
}
opts = internal.PkgResourceDefaultOpts(opts)
var resource AppSecIPGeoProtection
err := ctx.RegisterResource("akamai:index/appSecIPGeoProtection:AppSecIPGeoProtection", name, args, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// GetAppSecIPGeoProtection gets an existing AppSecIPGeoProtection 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 GetAppSecIPGeoProtection(ctx *pulumi.Context,
name string, id pulumi.IDInput, state *AppSecIPGeoProtectionState, opts ...pulumi.ResourceOption) (*AppSecIPGeoProtection, error) {
var resource AppSecIPGeoProtection
err := ctx.ReadResource("akamai:index/appSecIPGeoProtection:AppSecIPGeoProtection", name, id, state, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// Input properties used for looking up and filtering AppSecIPGeoProtection resources.
type appSecIPGeoProtectionState struct {
// Unique identifier of the security configuration
ConfigId *int `pulumi:"configId"`
// Whether to enable IP/Geo protection
Enabled *bool `pulumi:"enabled"`
// Text representation
OutputText *string `pulumi:"outputText"`
// Unique identifier of the security policy
SecurityPolicyId *string `pulumi:"securityPolicyId"`
}
type AppSecIPGeoProtectionState struct {
// Unique identifier of the security configuration
ConfigId pulumi.IntPtrInput
// Whether to enable IP/Geo protection
Enabled pulumi.BoolPtrInput
// Text representation
OutputText pulumi.StringPtrInput
// Unique identifier of the security policy
SecurityPolicyId pulumi.StringPtrInput
}
func (AppSecIPGeoProtectionState) ElementType() reflect.Type {
return reflect.TypeOf((*appSecIPGeoProtectionState)(nil)).Elem()
}
type appSecIPGeoProtectionArgs struct {
// Unique identifier of the security configuration
ConfigId int `pulumi:"configId"`
// Whether to enable IP/Geo protection
Enabled bool `pulumi:"enabled"`
// Unique identifier of the security policy
SecurityPolicyId string `pulumi:"securityPolicyId"`
}
// The set of arguments for constructing a AppSecIPGeoProtection resource.
type AppSecIPGeoProtectionArgs struct {
// Unique identifier of the security configuration
ConfigId pulumi.IntInput
// Whether to enable IP/Geo protection
Enabled pulumi.BoolInput
// Unique identifier of the security policy
SecurityPolicyId pulumi.StringInput
}
func (AppSecIPGeoProtectionArgs) ElementType() reflect.Type {
return reflect.TypeOf((*appSecIPGeoProtectionArgs)(nil)).Elem()
}
type AppSecIPGeoProtectionInput interface {
pulumi.Input
ToAppSecIPGeoProtectionOutput() AppSecIPGeoProtectionOutput
ToAppSecIPGeoProtectionOutputWithContext(ctx context.Context) AppSecIPGeoProtectionOutput
}
func (*AppSecIPGeoProtection) ElementType() reflect.Type {
return reflect.TypeOf((**AppSecIPGeoProtection)(nil)).Elem()
}
func (i *AppSecIPGeoProtection) ToAppSecIPGeoProtectionOutput() AppSecIPGeoProtectionOutput {
return i.ToAppSecIPGeoProtectionOutputWithContext(context.Background())
}
func (i *AppSecIPGeoProtection) ToAppSecIPGeoProtectionOutputWithContext(ctx context.Context) AppSecIPGeoProtectionOutput {
return pulumi.ToOutputWithContext(ctx, i).(AppSecIPGeoProtectionOutput)
}
// AppSecIPGeoProtectionArrayInput is an input type that accepts AppSecIPGeoProtectionArray and AppSecIPGeoProtectionArrayOutput values.
// You can construct a concrete instance of `AppSecIPGeoProtectionArrayInput` via:
//
// AppSecIPGeoProtectionArray{ AppSecIPGeoProtectionArgs{...} }
type AppSecIPGeoProtectionArrayInput interface {
pulumi.Input
ToAppSecIPGeoProtectionArrayOutput() AppSecIPGeoProtectionArrayOutput
ToAppSecIPGeoProtectionArrayOutputWithContext(context.Context) AppSecIPGeoProtectionArrayOutput
}
type AppSecIPGeoProtectionArray []AppSecIPGeoProtectionInput
func (AppSecIPGeoProtectionArray) ElementType() reflect.Type {
return reflect.TypeOf((*[]*AppSecIPGeoProtection)(nil)).Elem()
}
func (i AppSecIPGeoProtectionArray) ToAppSecIPGeoProtectionArrayOutput() AppSecIPGeoProtectionArrayOutput {
return i.ToAppSecIPGeoProtectionArrayOutputWithContext(context.Background())
}
func (i AppSecIPGeoProtectionArray) ToAppSecIPGeoProtectionArrayOutputWithContext(ctx context.Context) AppSecIPGeoProtectionArrayOutput {
return pulumi.ToOutputWithContext(ctx, i).(AppSecIPGeoProtectionArrayOutput)
}
// AppSecIPGeoProtectionMapInput is an input type that accepts AppSecIPGeoProtectionMap and AppSecIPGeoProtectionMapOutput values.
// You can construct a concrete instance of `AppSecIPGeoProtectionMapInput` via:
//
// AppSecIPGeoProtectionMap{ "key": AppSecIPGeoProtectionArgs{...} }
type AppSecIPGeoProtectionMapInput interface {
pulumi.Input
ToAppSecIPGeoProtectionMapOutput() AppSecIPGeoProtectionMapOutput
ToAppSecIPGeoProtectionMapOutputWithContext(context.Context) AppSecIPGeoProtectionMapOutput
}
type AppSecIPGeoProtectionMap map[string]AppSecIPGeoProtectionInput
func (AppSecIPGeoProtectionMap) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*AppSecIPGeoProtection)(nil)).Elem()
}
func (i AppSecIPGeoProtectionMap) ToAppSecIPGeoProtectionMapOutput() AppSecIPGeoProtectionMapOutput {
return i.ToAppSecIPGeoProtectionMapOutputWithContext(context.Background())
}
func (i AppSecIPGeoProtectionMap) ToAppSecIPGeoProtectionMapOutputWithContext(ctx context.Context) AppSecIPGeoProtectionMapOutput {
return pulumi.ToOutputWithContext(ctx, i).(AppSecIPGeoProtectionMapOutput)
}
type AppSecIPGeoProtectionOutput struct{ *pulumi.OutputState }
func (AppSecIPGeoProtectionOutput) ElementType() reflect.Type {
return reflect.TypeOf((**AppSecIPGeoProtection)(nil)).Elem()
}
func (o AppSecIPGeoProtectionOutput) ToAppSecIPGeoProtectionOutput() AppSecIPGeoProtectionOutput {
return o
}
func (o AppSecIPGeoProtectionOutput) ToAppSecIPGeoProtectionOutputWithContext(ctx context.Context) AppSecIPGeoProtectionOutput {
return o
}
// Unique identifier of the security configuration
func (o AppSecIPGeoProtectionOutput) ConfigId() pulumi.IntOutput {
return o.ApplyT(func(v *AppSecIPGeoProtection) pulumi.IntOutput { return v.ConfigId }).(pulumi.IntOutput)
}
// Whether to enable IP/Geo protection
func (o AppSecIPGeoProtectionOutput) Enabled() pulumi.BoolOutput {
return o.ApplyT(func(v *AppSecIPGeoProtection) pulumi.BoolOutput { return v.Enabled }).(pulumi.BoolOutput)
}
// Text representation
func (o AppSecIPGeoProtectionOutput) OutputText() pulumi.StringOutput {
return o.ApplyT(func(v *AppSecIPGeoProtection) pulumi.StringOutput { return v.OutputText }).(pulumi.StringOutput)
}
// Unique identifier of the security policy
func (o AppSecIPGeoProtectionOutput) SecurityPolicyId() pulumi.StringOutput {
return o.ApplyT(func(v *AppSecIPGeoProtection) pulumi.StringOutput { return v.SecurityPolicyId }).(pulumi.StringOutput)
}
type AppSecIPGeoProtectionArrayOutput struct{ *pulumi.OutputState }
func (AppSecIPGeoProtectionArrayOutput) ElementType() reflect.Type {
return reflect.TypeOf((*[]*AppSecIPGeoProtection)(nil)).Elem()
}
func (o AppSecIPGeoProtectionArrayOutput) ToAppSecIPGeoProtectionArrayOutput() AppSecIPGeoProtectionArrayOutput {
return o
}
func (o AppSecIPGeoProtectionArrayOutput) ToAppSecIPGeoProtectionArrayOutputWithContext(ctx context.Context) AppSecIPGeoProtectionArrayOutput {
return o
}
func (o AppSecIPGeoProtectionArrayOutput) Index(i pulumi.IntInput) AppSecIPGeoProtectionOutput {
return pulumi.All(o, i).ApplyT(func(vs []interface{}) *AppSecIPGeoProtection {
return vs[0].([]*AppSecIPGeoProtection)[vs[1].(int)]
}).(AppSecIPGeoProtectionOutput)
}
type AppSecIPGeoProtectionMapOutput struct{ *pulumi.OutputState }
func (AppSecIPGeoProtectionMapOutput) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*AppSecIPGeoProtection)(nil)).Elem()
}
func (o AppSecIPGeoProtectionMapOutput) ToAppSecIPGeoProtectionMapOutput() AppSecIPGeoProtectionMapOutput {
return o
}
func (o AppSecIPGeoProtectionMapOutput) ToAppSecIPGeoProtectionMapOutputWithContext(ctx context.Context) AppSecIPGeoProtectionMapOutput {
return o
}
func (o AppSecIPGeoProtectionMapOutput) MapIndex(k pulumi.StringInput) AppSecIPGeoProtectionOutput {
return pulumi.All(o, k).ApplyT(func(vs []interface{}) *AppSecIPGeoProtection {
return vs[0].(map[string]*AppSecIPGeoProtection)[vs[1].(string)]
}).(AppSecIPGeoProtectionOutput)
}
func init() {
pulumi.RegisterInputType(reflect.TypeOf((*AppSecIPGeoProtectionInput)(nil)).Elem(), &AppSecIPGeoProtection{})
pulumi.RegisterInputType(reflect.TypeOf((*AppSecIPGeoProtectionArrayInput)(nil)).Elem(), AppSecIPGeoProtectionArray{})
pulumi.RegisterInputType(reflect.TypeOf((*AppSecIPGeoProtectionMapInput)(nil)).Elem(), AppSecIPGeoProtectionMap{})
pulumi.RegisterOutputType(AppSecIPGeoProtectionOutput{})
pulumi.RegisterOutputType(AppSecIPGeoProtectionArrayOutput{})
pulumi.RegisterOutputType(AppSecIPGeoProtectionMapOutput{})
}