/
geoMatchSet.go
264 lines (218 loc) · 8.46 KB
/
geoMatchSet.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
// *** 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 Geo 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.NewGeoMatchSet(ctx, "geoMatchSet", &waf.GeoMatchSetArgs{
// GeoMatchConstraints: waf.GeoMatchSetGeoMatchConstraintArray{
// &waf.GeoMatchSetGeoMatchConstraintArgs{
// Type: pulumi.String("Country"),
// Value: pulumi.String("US"),
// },
// &waf.GeoMatchSetGeoMatchConstraintArgs{
// Type: pulumi.String("Country"),
// Value: pulumi.String("CA"),
// },
// },
// })
// if err != nil {
// return err
// }
// return nil
// })
// }
// ```
//
// ## Import
//
// WAF Geo Match Set can be imported using their ID, e.g.,
//
// ```sh
// $ pulumi import aws:waf/geoMatchSet:GeoMatchSet example a1b2c3d4-d5f6-7777-8888-9999aaaabbbbcccc
// ```
type GeoMatchSet struct {
pulumi.CustomResourceState
// Amazon Resource Name (ARN)
Arn pulumi.StringOutput `pulumi:"arn"`
// The GeoMatchConstraint objects which contain the country that you want AWS WAF to search for.
GeoMatchConstraints GeoMatchSetGeoMatchConstraintArrayOutput `pulumi:"geoMatchConstraints"`
// The name or description of the GeoMatchSet.
Name pulumi.StringOutput `pulumi:"name"`
}
// NewGeoMatchSet registers a new resource with the given unique name, arguments, and options.
func NewGeoMatchSet(ctx *pulumi.Context,
name string, args *GeoMatchSetArgs, opts ...pulumi.ResourceOption) (*GeoMatchSet, error) {
if args == nil {
args = &GeoMatchSetArgs{}
}
var resource GeoMatchSet
err := ctx.RegisterResource("aws:waf/geoMatchSet:GeoMatchSet", name, args, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// GetGeoMatchSet gets an existing GeoMatchSet 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 GetGeoMatchSet(ctx *pulumi.Context,
name string, id pulumi.IDInput, state *GeoMatchSetState, opts ...pulumi.ResourceOption) (*GeoMatchSet, error) {
var resource GeoMatchSet
err := ctx.ReadResource("aws:waf/geoMatchSet:GeoMatchSet", name, id, state, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// Input properties used for looking up and filtering GeoMatchSet resources.
type geoMatchSetState struct {
// Amazon Resource Name (ARN)
Arn *string `pulumi:"arn"`
// The GeoMatchConstraint objects which contain the country that you want AWS WAF to search for.
GeoMatchConstraints []GeoMatchSetGeoMatchConstraint `pulumi:"geoMatchConstraints"`
// The name or description of the GeoMatchSet.
Name *string `pulumi:"name"`
}
type GeoMatchSetState struct {
// Amazon Resource Name (ARN)
Arn pulumi.StringPtrInput
// The GeoMatchConstraint objects which contain the country that you want AWS WAF to search for.
GeoMatchConstraints GeoMatchSetGeoMatchConstraintArrayInput
// The name or description of the GeoMatchSet.
Name pulumi.StringPtrInput
}
func (GeoMatchSetState) ElementType() reflect.Type {
return reflect.TypeOf((*geoMatchSetState)(nil)).Elem()
}
type geoMatchSetArgs struct {
// The GeoMatchConstraint objects which contain the country that you want AWS WAF to search for.
GeoMatchConstraints []GeoMatchSetGeoMatchConstraint `pulumi:"geoMatchConstraints"`
// The name or description of the GeoMatchSet.
Name *string `pulumi:"name"`
}
// The set of arguments for constructing a GeoMatchSet resource.
type GeoMatchSetArgs struct {
// The GeoMatchConstraint objects which contain the country that you want AWS WAF to search for.
GeoMatchConstraints GeoMatchSetGeoMatchConstraintArrayInput
// The name or description of the GeoMatchSet.
Name pulumi.StringPtrInput
}
func (GeoMatchSetArgs) ElementType() reflect.Type {
return reflect.TypeOf((*geoMatchSetArgs)(nil)).Elem()
}
type GeoMatchSetInput interface {
pulumi.Input
ToGeoMatchSetOutput() GeoMatchSetOutput
ToGeoMatchSetOutputWithContext(ctx context.Context) GeoMatchSetOutput
}
func (*GeoMatchSet) ElementType() reflect.Type {
return reflect.TypeOf((**GeoMatchSet)(nil)).Elem()
}
func (i *GeoMatchSet) ToGeoMatchSetOutput() GeoMatchSetOutput {
return i.ToGeoMatchSetOutputWithContext(context.Background())
}
func (i *GeoMatchSet) ToGeoMatchSetOutputWithContext(ctx context.Context) GeoMatchSetOutput {
return pulumi.ToOutputWithContext(ctx, i).(GeoMatchSetOutput)
}
// GeoMatchSetArrayInput is an input type that accepts GeoMatchSetArray and GeoMatchSetArrayOutput values.
// You can construct a concrete instance of `GeoMatchSetArrayInput` via:
//
// GeoMatchSetArray{ GeoMatchSetArgs{...} }
type GeoMatchSetArrayInput interface {
pulumi.Input
ToGeoMatchSetArrayOutput() GeoMatchSetArrayOutput
ToGeoMatchSetArrayOutputWithContext(context.Context) GeoMatchSetArrayOutput
}
type GeoMatchSetArray []GeoMatchSetInput
func (GeoMatchSetArray) ElementType() reflect.Type {
return reflect.TypeOf((*[]*GeoMatchSet)(nil)).Elem()
}
func (i GeoMatchSetArray) ToGeoMatchSetArrayOutput() GeoMatchSetArrayOutput {
return i.ToGeoMatchSetArrayOutputWithContext(context.Background())
}
func (i GeoMatchSetArray) ToGeoMatchSetArrayOutputWithContext(ctx context.Context) GeoMatchSetArrayOutput {
return pulumi.ToOutputWithContext(ctx, i).(GeoMatchSetArrayOutput)
}
// GeoMatchSetMapInput is an input type that accepts GeoMatchSetMap and GeoMatchSetMapOutput values.
// You can construct a concrete instance of `GeoMatchSetMapInput` via:
//
// GeoMatchSetMap{ "key": GeoMatchSetArgs{...} }
type GeoMatchSetMapInput interface {
pulumi.Input
ToGeoMatchSetMapOutput() GeoMatchSetMapOutput
ToGeoMatchSetMapOutputWithContext(context.Context) GeoMatchSetMapOutput
}
type GeoMatchSetMap map[string]GeoMatchSetInput
func (GeoMatchSetMap) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*GeoMatchSet)(nil)).Elem()
}
func (i GeoMatchSetMap) ToGeoMatchSetMapOutput() GeoMatchSetMapOutput {
return i.ToGeoMatchSetMapOutputWithContext(context.Background())
}
func (i GeoMatchSetMap) ToGeoMatchSetMapOutputWithContext(ctx context.Context) GeoMatchSetMapOutput {
return pulumi.ToOutputWithContext(ctx, i).(GeoMatchSetMapOutput)
}
type GeoMatchSetOutput struct{ *pulumi.OutputState }
func (GeoMatchSetOutput) ElementType() reflect.Type {
return reflect.TypeOf((**GeoMatchSet)(nil)).Elem()
}
func (o GeoMatchSetOutput) ToGeoMatchSetOutput() GeoMatchSetOutput {
return o
}
func (o GeoMatchSetOutput) ToGeoMatchSetOutputWithContext(ctx context.Context) GeoMatchSetOutput {
return o
}
type GeoMatchSetArrayOutput struct{ *pulumi.OutputState }
func (GeoMatchSetArrayOutput) ElementType() reflect.Type {
return reflect.TypeOf((*[]*GeoMatchSet)(nil)).Elem()
}
func (o GeoMatchSetArrayOutput) ToGeoMatchSetArrayOutput() GeoMatchSetArrayOutput {
return o
}
func (o GeoMatchSetArrayOutput) ToGeoMatchSetArrayOutputWithContext(ctx context.Context) GeoMatchSetArrayOutput {
return o
}
func (o GeoMatchSetArrayOutput) Index(i pulumi.IntInput) GeoMatchSetOutput {
return pulumi.All(o, i).ApplyT(func(vs []interface{}) *GeoMatchSet {
return vs[0].([]*GeoMatchSet)[vs[1].(int)]
}).(GeoMatchSetOutput)
}
type GeoMatchSetMapOutput struct{ *pulumi.OutputState }
func (GeoMatchSetMapOutput) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*GeoMatchSet)(nil)).Elem()
}
func (o GeoMatchSetMapOutput) ToGeoMatchSetMapOutput() GeoMatchSetMapOutput {
return o
}
func (o GeoMatchSetMapOutput) ToGeoMatchSetMapOutputWithContext(ctx context.Context) GeoMatchSetMapOutput {
return o
}
func (o GeoMatchSetMapOutput) MapIndex(k pulumi.StringInput) GeoMatchSetOutput {
return pulumi.All(o, k).ApplyT(func(vs []interface{}) *GeoMatchSet {
return vs[0].(map[string]*GeoMatchSet)[vs[1].(string)]
}).(GeoMatchSetOutput)
}
func init() {
pulumi.RegisterInputType(reflect.TypeOf((*GeoMatchSetInput)(nil)).Elem(), &GeoMatchSet{})
pulumi.RegisterInputType(reflect.TypeOf((*GeoMatchSetArrayInput)(nil)).Elem(), GeoMatchSetArray{})
pulumi.RegisterInputType(reflect.TypeOf((*GeoMatchSetMapInput)(nil)).Elem(), GeoMatchSetMap{})
pulumi.RegisterOutputType(GeoMatchSetOutput{})
pulumi.RegisterOutputType(GeoMatchSetArrayOutput{})
pulumi.RegisterOutputType(GeoMatchSetMapOutput{})
}