/
regexPatternSet.go
180 lines (149 loc) · 6.54 KB
/
regexPatternSet.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
// Code generated by pulumi-language-go DO NOT EDIT.
// *** WARNING: Do not edit by hand unless you're certain you know what you are doing! ***
package wafv2
import (
"context"
"reflect"
"errors"
"github.com/pulumi/pulumi-aws-native/sdk/go/aws"
"github.com/pulumi/pulumi-aws-native/sdk/go/aws/internal"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
// Contains a list of Regular expressions based on the provided inputs. RegexPatternSet can be used with other WAF entities with RegexPatternSetReferenceStatement to perform other actions .
type RegexPatternSet struct {
pulumi.CustomResourceState
// ARN of the WAF entity.
Arn pulumi.StringOutput `pulumi:"arn"`
// Id of the RegexPatternSet
AwsId pulumi.StringOutput `pulumi:"awsId"`
// Description of the entity.
Description pulumi.StringPtrOutput `pulumi:"description"`
// Name of the RegexPatternSet.
Name pulumi.StringPtrOutput `pulumi:"name"`
RegularExpressionList pulumi.StringArrayOutput `pulumi:"regularExpressionList"`
// Use CLOUDFRONT for CloudFront RegexPatternSet, use REGIONAL for Application Load Balancer and API Gateway.
Scope RegexPatternSetScopeOutput `pulumi:"scope"`
Tags aws.TagArrayOutput `pulumi:"tags"`
}
// NewRegexPatternSet registers a new resource with the given unique name, arguments, and options.
func NewRegexPatternSet(ctx *pulumi.Context,
name string, args *RegexPatternSetArgs, opts ...pulumi.ResourceOption) (*RegexPatternSet, error) {
if args == nil {
return nil, errors.New("missing one or more required arguments")
}
if args.RegularExpressionList == nil {
return nil, errors.New("invalid value for required argument 'RegularExpressionList'")
}
if args.Scope == nil {
return nil, errors.New("invalid value for required argument 'Scope'")
}
replaceOnChanges := pulumi.ReplaceOnChanges([]string{
"name",
"scope",
})
opts = append(opts, replaceOnChanges)
opts = internal.PkgResourceDefaultOpts(opts)
var resource RegexPatternSet
err := ctx.RegisterResource("aws-native:wafv2:RegexPatternSet", name, args, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// GetRegexPatternSet gets an existing RegexPatternSet 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 GetRegexPatternSet(ctx *pulumi.Context,
name string, id pulumi.IDInput, state *RegexPatternSetState, opts ...pulumi.ResourceOption) (*RegexPatternSet, error) {
var resource RegexPatternSet
err := ctx.ReadResource("aws-native:wafv2:RegexPatternSet", name, id, state, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// Input properties used for looking up and filtering RegexPatternSet resources.
type regexPatternSetState struct {
}
type RegexPatternSetState struct {
}
func (RegexPatternSetState) ElementType() reflect.Type {
return reflect.TypeOf((*regexPatternSetState)(nil)).Elem()
}
type regexPatternSetArgs struct {
// Description of the entity.
Description *string `pulumi:"description"`
// Name of the RegexPatternSet.
Name *string `pulumi:"name"`
RegularExpressionList []string `pulumi:"regularExpressionList"`
// Use CLOUDFRONT for CloudFront RegexPatternSet, use REGIONAL for Application Load Balancer and API Gateway.
Scope RegexPatternSetScope `pulumi:"scope"`
Tags []aws.Tag `pulumi:"tags"`
}
// The set of arguments for constructing a RegexPatternSet resource.
type RegexPatternSetArgs struct {
// Description of the entity.
Description pulumi.StringPtrInput
// Name of the RegexPatternSet.
Name pulumi.StringPtrInput
RegularExpressionList pulumi.StringArrayInput
// Use CLOUDFRONT for CloudFront RegexPatternSet, use REGIONAL for Application Load Balancer and API Gateway.
Scope RegexPatternSetScopeInput
Tags aws.TagArrayInput
}
func (RegexPatternSetArgs) ElementType() reflect.Type {
return reflect.TypeOf((*regexPatternSetArgs)(nil)).Elem()
}
type RegexPatternSetInput interface {
pulumi.Input
ToRegexPatternSetOutput() RegexPatternSetOutput
ToRegexPatternSetOutputWithContext(ctx context.Context) RegexPatternSetOutput
}
func (*RegexPatternSet) ElementType() reflect.Type {
return reflect.TypeOf((**RegexPatternSet)(nil)).Elem()
}
func (i *RegexPatternSet) ToRegexPatternSetOutput() RegexPatternSetOutput {
return i.ToRegexPatternSetOutputWithContext(context.Background())
}
func (i *RegexPatternSet) ToRegexPatternSetOutputWithContext(ctx context.Context) RegexPatternSetOutput {
return pulumi.ToOutputWithContext(ctx, i).(RegexPatternSetOutput)
}
type RegexPatternSetOutput struct{ *pulumi.OutputState }
func (RegexPatternSetOutput) ElementType() reflect.Type {
return reflect.TypeOf((**RegexPatternSet)(nil)).Elem()
}
func (o RegexPatternSetOutput) ToRegexPatternSetOutput() RegexPatternSetOutput {
return o
}
func (o RegexPatternSetOutput) ToRegexPatternSetOutputWithContext(ctx context.Context) RegexPatternSetOutput {
return o
}
// ARN of the WAF entity.
func (o RegexPatternSetOutput) Arn() pulumi.StringOutput {
return o.ApplyT(func(v *RegexPatternSet) pulumi.StringOutput { return v.Arn }).(pulumi.StringOutput)
}
// Id of the RegexPatternSet
func (o RegexPatternSetOutput) AwsId() pulumi.StringOutput {
return o.ApplyT(func(v *RegexPatternSet) pulumi.StringOutput { return v.AwsId }).(pulumi.StringOutput)
}
// Description of the entity.
func (o RegexPatternSetOutput) Description() pulumi.StringPtrOutput {
return o.ApplyT(func(v *RegexPatternSet) pulumi.StringPtrOutput { return v.Description }).(pulumi.StringPtrOutput)
}
// Name of the RegexPatternSet.
func (o RegexPatternSetOutput) Name() pulumi.StringPtrOutput {
return o.ApplyT(func(v *RegexPatternSet) pulumi.StringPtrOutput { return v.Name }).(pulumi.StringPtrOutput)
}
func (o RegexPatternSetOutput) RegularExpressionList() pulumi.StringArrayOutput {
return o.ApplyT(func(v *RegexPatternSet) pulumi.StringArrayOutput { return v.RegularExpressionList }).(pulumi.StringArrayOutput)
}
// Use CLOUDFRONT for CloudFront RegexPatternSet, use REGIONAL for Application Load Balancer and API Gateway.
func (o RegexPatternSetOutput) Scope() RegexPatternSetScopeOutput {
return o.ApplyT(func(v *RegexPatternSet) RegexPatternSetScopeOutput { return v.Scope }).(RegexPatternSetScopeOutput)
}
func (o RegexPatternSetOutput) Tags() aws.TagArrayOutput {
return o.ApplyT(func(v *RegexPatternSet) aws.TagArrayOutput { return v.Tags }).(aws.TagArrayOutput)
}
func init() {
pulumi.RegisterInputType(reflect.TypeOf((*RegexPatternSetInput)(nil)).Elem(), &RegexPatternSet{})
pulumi.RegisterOutputType(RegexPatternSetOutput{})
}