-
Notifications
You must be signed in to change notification settings - Fork 150
/
byteMatchSet.go
269 lines (223 loc) · 9.02 KB
/
byteMatchSet.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
// *** 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 waf
import (
"context"
"reflect"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
// Provides a WAF Byte Match Set Resource
//
// ## Example Usage
//
// ```go
// package main
//
// import (
// "github.com/pulumi/pulumi-aws/sdk/v4/go/aws/waf"
// "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
// )
//
// func main() {
// pulumi.Run(func(ctx *pulumi.Context) error {
// _, err := waf.NewByteMatchSet(ctx, "byteSet", &waf.ByteMatchSetArgs{
// ByteMatchTuples: waf.ByteMatchSetByteMatchTupleArray{
// &waf.ByteMatchSetByteMatchTupleArgs{
// FieldToMatch: &waf.ByteMatchSetByteMatchTupleFieldToMatchArgs{
// Data: pulumi.String("referer"),
// Type: pulumi.String("HEADER"),
// },
// PositionalConstraint: pulumi.String("CONTAINS"),
// TargetString: pulumi.String("badrefer1"),
// TextTransformation: pulumi.String("NONE"),
// },
// },
// })
// if err != nil {
// return err
// }
// return nil
// })
// }
// ```
//
// ## Import
//
// WAF Byte Match Set can be imported using the id, e.g.,
//
// ```sh
// $ pulumi import aws:waf/byteMatchSet:ByteMatchSet byte_set a1b2c3d4-d5f6-7777-8888-9999aaaabbbbcccc
// ```
type ByteMatchSet struct {
pulumi.CustomResourceState
// Specifies the bytes (typically a string that corresponds
// with ASCII characters) that you want to search for in web requests,
// the location in requests that you want to search, and other settings.
ByteMatchTuples ByteMatchSetByteMatchTupleArrayOutput `pulumi:"byteMatchTuples"`
// The name or description of the Byte Match Set.
Name pulumi.StringOutput `pulumi:"name"`
}
// NewByteMatchSet registers a new resource with the given unique name, arguments, and options.
func NewByteMatchSet(ctx *pulumi.Context,
name string, args *ByteMatchSetArgs, opts ...pulumi.ResourceOption) (*ByteMatchSet, error) {
if args == nil {
args = &ByteMatchSetArgs{}
}
var resource ByteMatchSet
err := ctx.RegisterResource("aws:waf/byteMatchSet:ByteMatchSet", name, args, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// GetByteMatchSet gets an existing ByteMatchSet 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 GetByteMatchSet(ctx *pulumi.Context,
name string, id pulumi.IDInput, state *ByteMatchSetState, opts ...pulumi.ResourceOption) (*ByteMatchSet, error) {
var resource ByteMatchSet
err := ctx.ReadResource("aws:waf/byteMatchSet:ByteMatchSet", name, id, state, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// Input properties used for looking up and filtering ByteMatchSet resources.
type byteMatchSetState struct {
// Specifies the bytes (typically a string that corresponds
// with ASCII characters) that you want to search for in web requests,
// the location in requests that you want to search, and other settings.
ByteMatchTuples []ByteMatchSetByteMatchTuple `pulumi:"byteMatchTuples"`
// The name or description of the Byte Match Set.
Name *string `pulumi:"name"`
}
type ByteMatchSetState struct {
// Specifies the bytes (typically a string that corresponds
// with ASCII characters) that you want to search for in web requests,
// the location in requests that you want to search, and other settings.
ByteMatchTuples ByteMatchSetByteMatchTupleArrayInput
// The name or description of the Byte Match Set.
Name pulumi.StringPtrInput
}
func (ByteMatchSetState) ElementType() reflect.Type {
return reflect.TypeOf((*byteMatchSetState)(nil)).Elem()
}
type byteMatchSetArgs struct {
// Specifies the bytes (typically a string that corresponds
// with ASCII characters) that you want to search for in web requests,
// the location in requests that you want to search, and other settings.
ByteMatchTuples []ByteMatchSetByteMatchTuple `pulumi:"byteMatchTuples"`
// The name or description of the Byte Match Set.
Name *string `pulumi:"name"`
}
// The set of arguments for constructing a ByteMatchSet resource.
type ByteMatchSetArgs struct {
// Specifies the bytes (typically a string that corresponds
// with ASCII characters) that you want to search for in web requests,
// the location in requests that you want to search, and other settings.
ByteMatchTuples ByteMatchSetByteMatchTupleArrayInput
// The name or description of the Byte Match Set.
Name pulumi.StringPtrInput
}
func (ByteMatchSetArgs) ElementType() reflect.Type {
return reflect.TypeOf((*byteMatchSetArgs)(nil)).Elem()
}
type ByteMatchSetInput interface {
pulumi.Input
ToByteMatchSetOutput() ByteMatchSetOutput
ToByteMatchSetOutputWithContext(ctx context.Context) ByteMatchSetOutput
}
func (*ByteMatchSet) ElementType() reflect.Type {
return reflect.TypeOf((**ByteMatchSet)(nil)).Elem()
}
func (i *ByteMatchSet) ToByteMatchSetOutput() ByteMatchSetOutput {
return i.ToByteMatchSetOutputWithContext(context.Background())
}
func (i *ByteMatchSet) ToByteMatchSetOutputWithContext(ctx context.Context) ByteMatchSetOutput {
return pulumi.ToOutputWithContext(ctx, i).(ByteMatchSetOutput)
}
// ByteMatchSetArrayInput is an input type that accepts ByteMatchSetArray and ByteMatchSetArrayOutput values.
// You can construct a concrete instance of `ByteMatchSetArrayInput` via:
//
// ByteMatchSetArray{ ByteMatchSetArgs{...} }
type ByteMatchSetArrayInput interface {
pulumi.Input
ToByteMatchSetArrayOutput() ByteMatchSetArrayOutput
ToByteMatchSetArrayOutputWithContext(context.Context) ByteMatchSetArrayOutput
}
type ByteMatchSetArray []ByteMatchSetInput
func (ByteMatchSetArray) ElementType() reflect.Type {
return reflect.TypeOf((*[]*ByteMatchSet)(nil)).Elem()
}
func (i ByteMatchSetArray) ToByteMatchSetArrayOutput() ByteMatchSetArrayOutput {
return i.ToByteMatchSetArrayOutputWithContext(context.Background())
}
func (i ByteMatchSetArray) ToByteMatchSetArrayOutputWithContext(ctx context.Context) ByteMatchSetArrayOutput {
return pulumi.ToOutputWithContext(ctx, i).(ByteMatchSetArrayOutput)
}
// ByteMatchSetMapInput is an input type that accepts ByteMatchSetMap and ByteMatchSetMapOutput values.
// You can construct a concrete instance of `ByteMatchSetMapInput` via:
//
// ByteMatchSetMap{ "key": ByteMatchSetArgs{...} }
type ByteMatchSetMapInput interface {
pulumi.Input
ToByteMatchSetMapOutput() ByteMatchSetMapOutput
ToByteMatchSetMapOutputWithContext(context.Context) ByteMatchSetMapOutput
}
type ByteMatchSetMap map[string]ByteMatchSetInput
func (ByteMatchSetMap) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*ByteMatchSet)(nil)).Elem()
}
func (i ByteMatchSetMap) ToByteMatchSetMapOutput() ByteMatchSetMapOutput {
return i.ToByteMatchSetMapOutputWithContext(context.Background())
}
func (i ByteMatchSetMap) ToByteMatchSetMapOutputWithContext(ctx context.Context) ByteMatchSetMapOutput {
return pulumi.ToOutputWithContext(ctx, i).(ByteMatchSetMapOutput)
}
type ByteMatchSetOutput struct{ *pulumi.OutputState }
func (ByteMatchSetOutput) ElementType() reflect.Type {
return reflect.TypeOf((**ByteMatchSet)(nil)).Elem()
}
func (o ByteMatchSetOutput) ToByteMatchSetOutput() ByteMatchSetOutput {
return o
}
func (o ByteMatchSetOutput) ToByteMatchSetOutputWithContext(ctx context.Context) ByteMatchSetOutput {
return o
}
type ByteMatchSetArrayOutput struct{ *pulumi.OutputState }
func (ByteMatchSetArrayOutput) ElementType() reflect.Type {
return reflect.TypeOf((*[]*ByteMatchSet)(nil)).Elem()
}
func (o ByteMatchSetArrayOutput) ToByteMatchSetArrayOutput() ByteMatchSetArrayOutput {
return o
}
func (o ByteMatchSetArrayOutput) ToByteMatchSetArrayOutputWithContext(ctx context.Context) ByteMatchSetArrayOutput {
return o
}
func (o ByteMatchSetArrayOutput) Index(i pulumi.IntInput) ByteMatchSetOutput {
return pulumi.All(o, i).ApplyT(func(vs []interface{}) *ByteMatchSet {
return vs[0].([]*ByteMatchSet)[vs[1].(int)]
}).(ByteMatchSetOutput)
}
type ByteMatchSetMapOutput struct{ *pulumi.OutputState }
func (ByteMatchSetMapOutput) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*ByteMatchSet)(nil)).Elem()
}
func (o ByteMatchSetMapOutput) ToByteMatchSetMapOutput() ByteMatchSetMapOutput {
return o
}
func (o ByteMatchSetMapOutput) ToByteMatchSetMapOutputWithContext(ctx context.Context) ByteMatchSetMapOutput {
return o
}
func (o ByteMatchSetMapOutput) MapIndex(k pulumi.StringInput) ByteMatchSetOutput {
return pulumi.All(o, k).ApplyT(func(vs []interface{}) *ByteMatchSet {
return vs[0].(map[string]*ByteMatchSet)[vs[1].(string)]
}).(ByteMatchSetOutput)
}
func init() {
pulumi.RegisterInputType(reflect.TypeOf((*ByteMatchSetInput)(nil)).Elem(), &ByteMatchSet{})
pulumi.RegisterInputType(reflect.TypeOf((*ByteMatchSetArrayInput)(nil)).Elem(), ByteMatchSetArray{})
pulumi.RegisterInputType(reflect.TypeOf((*ByteMatchSetMapInput)(nil)).Elem(), ByteMatchSetMap{})
pulumi.RegisterOutputType(ByteMatchSetOutput{})
pulumi.RegisterOutputType(ByteMatchSetArrayOutput{})
pulumi.RegisterOutputType(ByteMatchSetMapOutput{})
}