/
appSecMatchTarget.go
299 lines (239 loc) · 11.1 KB
/
appSecMatchTarget.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
// *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
// *** 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/v2/go/pulumi"
)
// The `AppSecMatchTarget` resource allows you to create or modify a match target associated with a given security configuration version.
type AppSecMatchTarget struct {
pulumi.CustomResourceState
// The ID of the security configuration to use.
ConfigId pulumi.IntOutput `pulumi:"configId"`
// The name of a JSON file containing one or more match target definitions ([format](https://developer.akamai.com/api/cloud_security/application_security/v1.html#postmatchtargets)).
Json pulumi.StringOutput `pulumi:"json"`
// The ID of the match target.
MatchTargetId pulumi.IntOutput `pulumi:"matchTargetId"`
// The version number of the security configuration to use.
Version pulumi.IntOutput `pulumi:"version"`
}
// NewAppSecMatchTarget registers a new resource with the given unique name, arguments, and options.
func NewAppSecMatchTarget(ctx *pulumi.Context,
name string, args *AppSecMatchTargetArgs, opts ...pulumi.ResourceOption) (*AppSecMatchTarget, 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.Json == nil {
return nil, errors.New("invalid value for required argument 'Json'")
}
if args.Version == nil {
return nil, errors.New("invalid value for required argument 'Version'")
}
var resource AppSecMatchTarget
err := ctx.RegisterResource("akamai:index/appSecMatchTarget:AppSecMatchTarget", name, args, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// GetAppSecMatchTarget gets an existing AppSecMatchTarget 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 GetAppSecMatchTarget(ctx *pulumi.Context,
name string, id pulumi.IDInput, state *AppSecMatchTargetState, opts ...pulumi.ResourceOption) (*AppSecMatchTarget, error) {
var resource AppSecMatchTarget
err := ctx.ReadResource("akamai:index/appSecMatchTarget:AppSecMatchTarget", name, id, state, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// Input properties used for looking up and filtering AppSecMatchTarget resources.
type appSecMatchTargetState struct {
// The ID of the security configuration to use.
ConfigId *int `pulumi:"configId"`
// The name of a JSON file containing one or more match target definitions ([format](https://developer.akamai.com/api/cloud_security/application_security/v1.html#postmatchtargets)).
Json *string `pulumi:"json"`
// The ID of the match target.
MatchTargetId *int `pulumi:"matchTargetId"`
// The version number of the security configuration to use.
Version *int `pulumi:"version"`
}
type AppSecMatchTargetState struct {
// The ID of the security configuration to use.
ConfigId pulumi.IntPtrInput
// The name of a JSON file containing one or more match target definitions ([format](https://developer.akamai.com/api/cloud_security/application_security/v1.html#postmatchtargets)).
Json pulumi.StringPtrInput
// The ID of the match target.
MatchTargetId pulumi.IntPtrInput
// The version number of the security configuration to use.
Version pulumi.IntPtrInput
}
func (AppSecMatchTargetState) ElementType() reflect.Type {
return reflect.TypeOf((*appSecMatchTargetState)(nil)).Elem()
}
type appSecMatchTargetArgs struct {
// The ID of the security configuration to use.
ConfigId int `pulumi:"configId"`
// The name of a JSON file containing one or more match target definitions ([format](https://developer.akamai.com/api/cloud_security/application_security/v1.html#postmatchtargets)).
Json string `pulumi:"json"`
// The version number of the security configuration to use.
Version int `pulumi:"version"`
}
// The set of arguments for constructing a AppSecMatchTarget resource.
type AppSecMatchTargetArgs struct {
// The ID of the security configuration to use.
ConfigId pulumi.IntInput
// The name of a JSON file containing one or more match target definitions ([format](https://developer.akamai.com/api/cloud_security/application_security/v1.html#postmatchtargets)).
Json pulumi.StringInput
// The version number of the security configuration to use.
Version pulumi.IntInput
}
func (AppSecMatchTargetArgs) ElementType() reflect.Type {
return reflect.TypeOf((*appSecMatchTargetArgs)(nil)).Elem()
}
type AppSecMatchTargetInput interface {
pulumi.Input
ToAppSecMatchTargetOutput() AppSecMatchTargetOutput
ToAppSecMatchTargetOutputWithContext(ctx context.Context) AppSecMatchTargetOutput
}
func (*AppSecMatchTarget) ElementType() reflect.Type {
return reflect.TypeOf((*AppSecMatchTarget)(nil))
}
func (i *AppSecMatchTarget) ToAppSecMatchTargetOutput() AppSecMatchTargetOutput {
return i.ToAppSecMatchTargetOutputWithContext(context.Background())
}
func (i *AppSecMatchTarget) ToAppSecMatchTargetOutputWithContext(ctx context.Context) AppSecMatchTargetOutput {
return pulumi.ToOutputWithContext(ctx, i).(AppSecMatchTargetOutput)
}
func (i *AppSecMatchTarget) ToAppSecMatchTargetPtrOutput() AppSecMatchTargetPtrOutput {
return i.ToAppSecMatchTargetPtrOutputWithContext(context.Background())
}
func (i *AppSecMatchTarget) ToAppSecMatchTargetPtrOutputWithContext(ctx context.Context) AppSecMatchTargetPtrOutput {
return pulumi.ToOutputWithContext(ctx, i).(AppSecMatchTargetPtrOutput)
}
type AppSecMatchTargetPtrInput interface {
pulumi.Input
ToAppSecMatchTargetPtrOutput() AppSecMatchTargetPtrOutput
ToAppSecMatchTargetPtrOutputWithContext(ctx context.Context) AppSecMatchTargetPtrOutput
}
type appSecMatchTargetPtrType AppSecMatchTargetArgs
func (*appSecMatchTargetPtrType) ElementType() reflect.Type {
return reflect.TypeOf((**AppSecMatchTarget)(nil))
}
func (i *appSecMatchTargetPtrType) ToAppSecMatchTargetPtrOutput() AppSecMatchTargetPtrOutput {
return i.ToAppSecMatchTargetPtrOutputWithContext(context.Background())
}
func (i *appSecMatchTargetPtrType) ToAppSecMatchTargetPtrOutputWithContext(ctx context.Context) AppSecMatchTargetPtrOutput {
return pulumi.ToOutputWithContext(ctx, i).(AppSecMatchTargetPtrOutput)
}
// AppSecMatchTargetArrayInput is an input type that accepts AppSecMatchTargetArray and AppSecMatchTargetArrayOutput values.
// You can construct a concrete instance of `AppSecMatchTargetArrayInput` via:
//
// AppSecMatchTargetArray{ AppSecMatchTargetArgs{...} }
type AppSecMatchTargetArrayInput interface {
pulumi.Input
ToAppSecMatchTargetArrayOutput() AppSecMatchTargetArrayOutput
ToAppSecMatchTargetArrayOutputWithContext(context.Context) AppSecMatchTargetArrayOutput
}
type AppSecMatchTargetArray []AppSecMatchTargetInput
func (AppSecMatchTargetArray) ElementType() reflect.Type {
return reflect.TypeOf(([]*AppSecMatchTarget)(nil))
}
func (i AppSecMatchTargetArray) ToAppSecMatchTargetArrayOutput() AppSecMatchTargetArrayOutput {
return i.ToAppSecMatchTargetArrayOutputWithContext(context.Background())
}
func (i AppSecMatchTargetArray) ToAppSecMatchTargetArrayOutputWithContext(ctx context.Context) AppSecMatchTargetArrayOutput {
return pulumi.ToOutputWithContext(ctx, i).(AppSecMatchTargetArrayOutput)
}
// AppSecMatchTargetMapInput is an input type that accepts AppSecMatchTargetMap and AppSecMatchTargetMapOutput values.
// You can construct a concrete instance of `AppSecMatchTargetMapInput` via:
//
// AppSecMatchTargetMap{ "key": AppSecMatchTargetArgs{...} }
type AppSecMatchTargetMapInput interface {
pulumi.Input
ToAppSecMatchTargetMapOutput() AppSecMatchTargetMapOutput
ToAppSecMatchTargetMapOutputWithContext(context.Context) AppSecMatchTargetMapOutput
}
type AppSecMatchTargetMap map[string]AppSecMatchTargetInput
func (AppSecMatchTargetMap) ElementType() reflect.Type {
return reflect.TypeOf((map[string]*AppSecMatchTarget)(nil))
}
func (i AppSecMatchTargetMap) ToAppSecMatchTargetMapOutput() AppSecMatchTargetMapOutput {
return i.ToAppSecMatchTargetMapOutputWithContext(context.Background())
}
func (i AppSecMatchTargetMap) ToAppSecMatchTargetMapOutputWithContext(ctx context.Context) AppSecMatchTargetMapOutput {
return pulumi.ToOutputWithContext(ctx, i).(AppSecMatchTargetMapOutput)
}
type AppSecMatchTargetOutput struct {
*pulumi.OutputState
}
func (AppSecMatchTargetOutput) ElementType() reflect.Type {
return reflect.TypeOf((*AppSecMatchTarget)(nil))
}
func (o AppSecMatchTargetOutput) ToAppSecMatchTargetOutput() AppSecMatchTargetOutput {
return o
}
func (o AppSecMatchTargetOutput) ToAppSecMatchTargetOutputWithContext(ctx context.Context) AppSecMatchTargetOutput {
return o
}
func (o AppSecMatchTargetOutput) ToAppSecMatchTargetPtrOutput() AppSecMatchTargetPtrOutput {
return o.ToAppSecMatchTargetPtrOutputWithContext(context.Background())
}
func (o AppSecMatchTargetOutput) ToAppSecMatchTargetPtrOutputWithContext(ctx context.Context) AppSecMatchTargetPtrOutput {
return o.ApplyT(func(v AppSecMatchTarget) *AppSecMatchTarget {
return &v
}).(AppSecMatchTargetPtrOutput)
}
type AppSecMatchTargetPtrOutput struct {
*pulumi.OutputState
}
func (AppSecMatchTargetPtrOutput) ElementType() reflect.Type {
return reflect.TypeOf((**AppSecMatchTarget)(nil))
}
func (o AppSecMatchTargetPtrOutput) ToAppSecMatchTargetPtrOutput() AppSecMatchTargetPtrOutput {
return o
}
func (o AppSecMatchTargetPtrOutput) ToAppSecMatchTargetPtrOutputWithContext(ctx context.Context) AppSecMatchTargetPtrOutput {
return o
}
type AppSecMatchTargetArrayOutput struct{ *pulumi.OutputState }
func (AppSecMatchTargetArrayOutput) ElementType() reflect.Type {
return reflect.TypeOf((*[]AppSecMatchTarget)(nil))
}
func (o AppSecMatchTargetArrayOutput) ToAppSecMatchTargetArrayOutput() AppSecMatchTargetArrayOutput {
return o
}
func (o AppSecMatchTargetArrayOutput) ToAppSecMatchTargetArrayOutputWithContext(ctx context.Context) AppSecMatchTargetArrayOutput {
return o
}
func (o AppSecMatchTargetArrayOutput) Index(i pulumi.IntInput) AppSecMatchTargetOutput {
return pulumi.All(o, i).ApplyT(func(vs []interface{}) AppSecMatchTarget {
return vs[0].([]AppSecMatchTarget)[vs[1].(int)]
}).(AppSecMatchTargetOutput)
}
type AppSecMatchTargetMapOutput struct{ *pulumi.OutputState }
func (AppSecMatchTargetMapOutput) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]AppSecMatchTarget)(nil))
}
func (o AppSecMatchTargetMapOutput) ToAppSecMatchTargetMapOutput() AppSecMatchTargetMapOutput {
return o
}
func (o AppSecMatchTargetMapOutput) ToAppSecMatchTargetMapOutputWithContext(ctx context.Context) AppSecMatchTargetMapOutput {
return o
}
func (o AppSecMatchTargetMapOutput) MapIndex(k pulumi.StringInput) AppSecMatchTargetOutput {
return pulumi.All(o, k).ApplyT(func(vs []interface{}) AppSecMatchTarget {
return vs[0].(map[string]AppSecMatchTarget)[vs[1].(string)]
}).(AppSecMatchTargetOutput)
}
func init() {
pulumi.RegisterOutputType(AppSecMatchTargetOutput{})
pulumi.RegisterOutputType(AppSecMatchTargetPtrOutput{})
pulumi.RegisterOutputType(AppSecMatchTargetArrayOutput{})
pulumi.RegisterOutputType(AppSecMatchTargetMapOutput{})
}