-
Notifications
You must be signed in to change notification settings - Fork 150
/
ipSet.go
264 lines (218 loc) · 7.75 KB
/
ipSet.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 IPSet 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.NewIpSet(ctx, "ipset", &waf.IpSetArgs{
// IpSetDescriptors: waf.IpSetIpSetDescriptorArray{
// &waf.IpSetIpSetDescriptorArgs{
// Type: pulumi.String("IPV4"),
// Value: pulumi.String("192.0.7.0/24"),
// },
// &waf.IpSetIpSetDescriptorArgs{
// Type: pulumi.String("IPV4"),
// Value: pulumi.String("10.16.16.0/16"),
// },
// },
// })
// if err != nil {
// return err
// }
// return nil
// })
// }
// ```
//
// ## Import
//
// WAF IPSets can be imported using their ID, e.g.,
//
// ```sh
// $ pulumi import aws:waf/ipSet:IpSet example a1b2c3d4-d5f6-7777-8888-9999aaaabbbbcccc
// ```
type IpSet struct {
pulumi.CustomResourceState
// The ARN of the WAF IPSet.
Arn pulumi.StringOutput `pulumi:"arn"`
// One or more pairs specifying the IP address type (IPV4 or IPV6) and the IP address range (in CIDR format) from which web requests originate.
IpSetDescriptors IpSetIpSetDescriptorArrayOutput `pulumi:"ipSetDescriptors"`
// The name or description of the IPSet.
Name pulumi.StringOutput `pulumi:"name"`
}
// NewIpSet registers a new resource with the given unique name, arguments, and options.
func NewIpSet(ctx *pulumi.Context,
name string, args *IpSetArgs, opts ...pulumi.ResourceOption) (*IpSet, error) {
if args == nil {
args = &IpSetArgs{}
}
var resource IpSet
err := ctx.RegisterResource("aws:waf/ipSet:IpSet", name, args, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// GetIpSet gets an existing IpSet 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 GetIpSet(ctx *pulumi.Context,
name string, id pulumi.IDInput, state *IpSetState, opts ...pulumi.ResourceOption) (*IpSet, error) {
var resource IpSet
err := ctx.ReadResource("aws:waf/ipSet:IpSet", name, id, state, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// Input properties used for looking up and filtering IpSet resources.
type ipSetState struct {
// The ARN of the WAF IPSet.
Arn *string `pulumi:"arn"`
// One or more pairs specifying the IP address type (IPV4 or IPV6) and the IP address range (in CIDR format) from which web requests originate.
IpSetDescriptors []IpSetIpSetDescriptor `pulumi:"ipSetDescriptors"`
// The name or description of the IPSet.
Name *string `pulumi:"name"`
}
type IpSetState struct {
// The ARN of the WAF IPSet.
Arn pulumi.StringPtrInput
// One or more pairs specifying the IP address type (IPV4 or IPV6) and the IP address range (in CIDR format) from which web requests originate.
IpSetDescriptors IpSetIpSetDescriptorArrayInput
// The name or description of the IPSet.
Name pulumi.StringPtrInput
}
func (IpSetState) ElementType() reflect.Type {
return reflect.TypeOf((*ipSetState)(nil)).Elem()
}
type ipSetArgs struct {
// One or more pairs specifying the IP address type (IPV4 or IPV6) and the IP address range (in CIDR format) from which web requests originate.
IpSetDescriptors []IpSetIpSetDescriptor `pulumi:"ipSetDescriptors"`
// The name or description of the IPSet.
Name *string `pulumi:"name"`
}
// The set of arguments for constructing a IpSet resource.
type IpSetArgs struct {
// One or more pairs specifying the IP address type (IPV4 or IPV6) and the IP address range (in CIDR format) from which web requests originate.
IpSetDescriptors IpSetIpSetDescriptorArrayInput
// The name or description of the IPSet.
Name pulumi.StringPtrInput
}
func (IpSetArgs) ElementType() reflect.Type {
return reflect.TypeOf((*ipSetArgs)(nil)).Elem()
}
type IpSetInput interface {
pulumi.Input
ToIpSetOutput() IpSetOutput
ToIpSetOutputWithContext(ctx context.Context) IpSetOutput
}
func (*IpSet) ElementType() reflect.Type {
return reflect.TypeOf((**IpSet)(nil)).Elem()
}
func (i *IpSet) ToIpSetOutput() IpSetOutput {
return i.ToIpSetOutputWithContext(context.Background())
}
func (i *IpSet) ToIpSetOutputWithContext(ctx context.Context) IpSetOutput {
return pulumi.ToOutputWithContext(ctx, i).(IpSetOutput)
}
// IpSetArrayInput is an input type that accepts IpSetArray and IpSetArrayOutput values.
// You can construct a concrete instance of `IpSetArrayInput` via:
//
// IpSetArray{ IpSetArgs{...} }
type IpSetArrayInput interface {
pulumi.Input
ToIpSetArrayOutput() IpSetArrayOutput
ToIpSetArrayOutputWithContext(context.Context) IpSetArrayOutput
}
type IpSetArray []IpSetInput
func (IpSetArray) ElementType() reflect.Type {
return reflect.TypeOf((*[]*IpSet)(nil)).Elem()
}
func (i IpSetArray) ToIpSetArrayOutput() IpSetArrayOutput {
return i.ToIpSetArrayOutputWithContext(context.Background())
}
func (i IpSetArray) ToIpSetArrayOutputWithContext(ctx context.Context) IpSetArrayOutput {
return pulumi.ToOutputWithContext(ctx, i).(IpSetArrayOutput)
}
// IpSetMapInput is an input type that accepts IpSetMap and IpSetMapOutput values.
// You can construct a concrete instance of `IpSetMapInput` via:
//
// IpSetMap{ "key": IpSetArgs{...} }
type IpSetMapInput interface {
pulumi.Input
ToIpSetMapOutput() IpSetMapOutput
ToIpSetMapOutputWithContext(context.Context) IpSetMapOutput
}
type IpSetMap map[string]IpSetInput
func (IpSetMap) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*IpSet)(nil)).Elem()
}
func (i IpSetMap) ToIpSetMapOutput() IpSetMapOutput {
return i.ToIpSetMapOutputWithContext(context.Background())
}
func (i IpSetMap) ToIpSetMapOutputWithContext(ctx context.Context) IpSetMapOutput {
return pulumi.ToOutputWithContext(ctx, i).(IpSetMapOutput)
}
type IpSetOutput struct{ *pulumi.OutputState }
func (IpSetOutput) ElementType() reflect.Type {
return reflect.TypeOf((**IpSet)(nil)).Elem()
}
func (o IpSetOutput) ToIpSetOutput() IpSetOutput {
return o
}
func (o IpSetOutput) ToIpSetOutputWithContext(ctx context.Context) IpSetOutput {
return o
}
type IpSetArrayOutput struct{ *pulumi.OutputState }
func (IpSetArrayOutput) ElementType() reflect.Type {
return reflect.TypeOf((*[]*IpSet)(nil)).Elem()
}
func (o IpSetArrayOutput) ToIpSetArrayOutput() IpSetArrayOutput {
return o
}
func (o IpSetArrayOutput) ToIpSetArrayOutputWithContext(ctx context.Context) IpSetArrayOutput {
return o
}
func (o IpSetArrayOutput) Index(i pulumi.IntInput) IpSetOutput {
return pulumi.All(o, i).ApplyT(func(vs []interface{}) *IpSet {
return vs[0].([]*IpSet)[vs[1].(int)]
}).(IpSetOutput)
}
type IpSetMapOutput struct{ *pulumi.OutputState }
func (IpSetMapOutput) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*IpSet)(nil)).Elem()
}
func (o IpSetMapOutput) ToIpSetMapOutput() IpSetMapOutput {
return o
}
func (o IpSetMapOutput) ToIpSetMapOutputWithContext(ctx context.Context) IpSetMapOutput {
return o
}
func (o IpSetMapOutput) MapIndex(k pulumi.StringInput) IpSetOutput {
return pulumi.All(o, k).ApplyT(func(vs []interface{}) *IpSet {
return vs[0].(map[string]*IpSet)[vs[1].(string)]
}).(IpSetOutput)
}
func init() {
pulumi.RegisterInputType(reflect.TypeOf((*IpSetInput)(nil)).Elem(), &IpSet{})
pulumi.RegisterInputType(reflect.TypeOf((*IpSetArrayInput)(nil)).Elem(), IpSetArray{})
pulumi.RegisterInputType(reflect.TypeOf((*IpSetMapInput)(nil)).Elem(), IpSetMap{})
pulumi.RegisterOutputType(IpSetOutput{})
pulumi.RegisterOutputType(IpSetArrayOutput{})
pulumi.RegisterOutputType(IpSetMapOutput{})
}