github.com/pulumi/pulumi-aws/sdk/v6@v6.32.0/go/aws/wafregional/regexMatchSet.go (about) 1 // Code generated by the Pulumi Terraform Bridge (tfgen) Tool DO NOT EDIT. 2 // *** WARNING: Do not edit by hand unless you're certain you know what you are doing! *** 3 4 package wafregional 5 6 import ( 7 "context" 8 "reflect" 9 10 "github.com/pulumi/pulumi-aws/sdk/v6/go/aws/internal" 11 "github.com/pulumi/pulumi/sdk/v3/go/pulumi" 12 ) 13 14 // Provides a WAF Regional Regex Match Set Resource 15 // 16 // ## Example Usage 17 // 18 // <!--Start PulumiCodeChooser --> 19 // ```go 20 // package main 21 // 22 // import ( 23 // 24 // "github.com/pulumi/pulumi-aws/sdk/v6/go/aws/wafregional" 25 // "github.com/pulumi/pulumi/sdk/v3/go/pulumi" 26 // 27 // ) 28 // 29 // func main() { 30 // pulumi.Run(func(ctx *pulumi.Context) error { 31 // exampleRegexPatternSet, err := wafregional.NewRegexPatternSet(ctx, "example", &wafregional.RegexPatternSetArgs{ 32 // Name: pulumi.String("example"), 33 // RegexPatternStrings: pulumi.StringArray{ 34 // pulumi.String("one"), 35 // pulumi.String("two"), 36 // }, 37 // }) 38 // if err != nil { 39 // return err 40 // } 41 // _, err = wafregional.NewRegexMatchSet(ctx, "example", &wafregional.RegexMatchSetArgs{ 42 // Name: pulumi.String("example"), 43 // RegexMatchTuples: wafregional.RegexMatchSetRegexMatchTupleArray{ 44 // &wafregional.RegexMatchSetRegexMatchTupleArgs{ 45 // FieldToMatch: &wafregional.RegexMatchSetRegexMatchTupleFieldToMatchArgs{ 46 // Data: pulumi.String("User-Agent"), 47 // Type: pulumi.String("HEADER"), 48 // }, 49 // RegexPatternSetId: exampleRegexPatternSet.ID(), 50 // TextTransformation: pulumi.String("NONE"), 51 // }, 52 // }, 53 // }) 54 // if err != nil { 55 // return err 56 // } 57 // return nil 58 // }) 59 // } 60 // 61 // ``` 62 // <!--End PulumiCodeChooser --> 63 // 64 // ## Import 65 // 66 // Using `pulumi import`, import WAF Regional Regex Match Set using the id. For example: 67 // 68 // ```sh 69 // $ pulumi import aws:wafregional/regexMatchSet:RegexMatchSet example a1b2c3d4-d5f6-7777-8888-9999aaaabbbbcccc 70 // ``` 71 type RegexMatchSet struct { 72 pulumi.CustomResourceState 73 74 // The name or description of the Regex Match Set. 75 Name pulumi.StringOutput `pulumi:"name"` 76 // The regular expression pattern that you want AWS WAF to search for in web requests, the location in requests that you want AWS WAF to search, and other settings. See below. 77 RegexMatchTuples RegexMatchSetRegexMatchTupleArrayOutput `pulumi:"regexMatchTuples"` 78 } 79 80 // NewRegexMatchSet registers a new resource with the given unique name, arguments, and options. 81 func NewRegexMatchSet(ctx *pulumi.Context, 82 name string, args *RegexMatchSetArgs, opts ...pulumi.ResourceOption) (*RegexMatchSet, error) { 83 if args == nil { 84 args = &RegexMatchSetArgs{} 85 } 86 87 opts = internal.PkgResourceDefaultOpts(opts) 88 var resource RegexMatchSet 89 err := ctx.RegisterResource("aws:wafregional/regexMatchSet:RegexMatchSet", name, args, &resource, opts...) 90 if err != nil { 91 return nil, err 92 } 93 return &resource, nil 94 } 95 96 // GetRegexMatchSet gets an existing RegexMatchSet resource's state with the given name, ID, and optional 97 // state properties that are used to uniquely qualify the lookup (nil if not required). 98 func GetRegexMatchSet(ctx *pulumi.Context, 99 name string, id pulumi.IDInput, state *RegexMatchSetState, opts ...pulumi.ResourceOption) (*RegexMatchSet, error) { 100 var resource RegexMatchSet 101 err := ctx.ReadResource("aws:wafregional/regexMatchSet:RegexMatchSet", name, id, state, &resource, opts...) 102 if err != nil { 103 return nil, err 104 } 105 return &resource, nil 106 } 107 108 // Input properties used for looking up and filtering RegexMatchSet resources. 109 type regexMatchSetState struct { 110 // The name or description of the Regex Match Set. 111 Name *string `pulumi:"name"` 112 // The regular expression pattern that you want AWS WAF to search for in web requests, the location in requests that you want AWS WAF to search, and other settings. See below. 113 RegexMatchTuples []RegexMatchSetRegexMatchTuple `pulumi:"regexMatchTuples"` 114 } 115 116 type RegexMatchSetState struct { 117 // The name or description of the Regex Match Set. 118 Name pulumi.StringPtrInput 119 // The regular expression pattern that you want AWS WAF to search for in web requests, the location in requests that you want AWS WAF to search, and other settings. See below. 120 RegexMatchTuples RegexMatchSetRegexMatchTupleArrayInput 121 } 122 123 func (RegexMatchSetState) ElementType() reflect.Type { 124 return reflect.TypeOf((*regexMatchSetState)(nil)).Elem() 125 } 126 127 type regexMatchSetArgs struct { 128 // The name or description of the Regex Match Set. 129 Name *string `pulumi:"name"` 130 // The regular expression pattern that you want AWS WAF to search for in web requests, the location in requests that you want AWS WAF to search, and other settings. See below. 131 RegexMatchTuples []RegexMatchSetRegexMatchTuple `pulumi:"regexMatchTuples"` 132 } 133 134 // The set of arguments for constructing a RegexMatchSet resource. 135 type RegexMatchSetArgs struct { 136 // The name or description of the Regex Match Set. 137 Name pulumi.StringPtrInput 138 // The regular expression pattern that you want AWS WAF to search for in web requests, the location in requests that you want AWS WAF to search, and other settings. See below. 139 RegexMatchTuples RegexMatchSetRegexMatchTupleArrayInput 140 } 141 142 func (RegexMatchSetArgs) ElementType() reflect.Type { 143 return reflect.TypeOf((*regexMatchSetArgs)(nil)).Elem() 144 } 145 146 type RegexMatchSetInput interface { 147 pulumi.Input 148 149 ToRegexMatchSetOutput() RegexMatchSetOutput 150 ToRegexMatchSetOutputWithContext(ctx context.Context) RegexMatchSetOutput 151 } 152 153 func (*RegexMatchSet) ElementType() reflect.Type { 154 return reflect.TypeOf((**RegexMatchSet)(nil)).Elem() 155 } 156 157 func (i *RegexMatchSet) ToRegexMatchSetOutput() RegexMatchSetOutput { 158 return i.ToRegexMatchSetOutputWithContext(context.Background()) 159 } 160 161 func (i *RegexMatchSet) ToRegexMatchSetOutputWithContext(ctx context.Context) RegexMatchSetOutput { 162 return pulumi.ToOutputWithContext(ctx, i).(RegexMatchSetOutput) 163 } 164 165 // RegexMatchSetArrayInput is an input type that accepts RegexMatchSetArray and RegexMatchSetArrayOutput values. 166 // You can construct a concrete instance of `RegexMatchSetArrayInput` via: 167 // 168 // RegexMatchSetArray{ RegexMatchSetArgs{...} } 169 type RegexMatchSetArrayInput interface { 170 pulumi.Input 171 172 ToRegexMatchSetArrayOutput() RegexMatchSetArrayOutput 173 ToRegexMatchSetArrayOutputWithContext(context.Context) RegexMatchSetArrayOutput 174 } 175 176 type RegexMatchSetArray []RegexMatchSetInput 177 178 func (RegexMatchSetArray) ElementType() reflect.Type { 179 return reflect.TypeOf((*[]*RegexMatchSet)(nil)).Elem() 180 } 181 182 func (i RegexMatchSetArray) ToRegexMatchSetArrayOutput() RegexMatchSetArrayOutput { 183 return i.ToRegexMatchSetArrayOutputWithContext(context.Background()) 184 } 185 186 func (i RegexMatchSetArray) ToRegexMatchSetArrayOutputWithContext(ctx context.Context) RegexMatchSetArrayOutput { 187 return pulumi.ToOutputWithContext(ctx, i).(RegexMatchSetArrayOutput) 188 } 189 190 // RegexMatchSetMapInput is an input type that accepts RegexMatchSetMap and RegexMatchSetMapOutput values. 191 // You can construct a concrete instance of `RegexMatchSetMapInput` via: 192 // 193 // RegexMatchSetMap{ "key": RegexMatchSetArgs{...} } 194 type RegexMatchSetMapInput interface { 195 pulumi.Input 196 197 ToRegexMatchSetMapOutput() RegexMatchSetMapOutput 198 ToRegexMatchSetMapOutputWithContext(context.Context) RegexMatchSetMapOutput 199 } 200 201 type RegexMatchSetMap map[string]RegexMatchSetInput 202 203 func (RegexMatchSetMap) ElementType() reflect.Type { 204 return reflect.TypeOf((*map[string]*RegexMatchSet)(nil)).Elem() 205 } 206 207 func (i RegexMatchSetMap) ToRegexMatchSetMapOutput() RegexMatchSetMapOutput { 208 return i.ToRegexMatchSetMapOutputWithContext(context.Background()) 209 } 210 211 func (i RegexMatchSetMap) ToRegexMatchSetMapOutputWithContext(ctx context.Context) RegexMatchSetMapOutput { 212 return pulumi.ToOutputWithContext(ctx, i).(RegexMatchSetMapOutput) 213 } 214 215 type RegexMatchSetOutput struct{ *pulumi.OutputState } 216 217 func (RegexMatchSetOutput) ElementType() reflect.Type { 218 return reflect.TypeOf((**RegexMatchSet)(nil)).Elem() 219 } 220 221 func (o RegexMatchSetOutput) ToRegexMatchSetOutput() RegexMatchSetOutput { 222 return o 223 } 224 225 func (o RegexMatchSetOutput) ToRegexMatchSetOutputWithContext(ctx context.Context) RegexMatchSetOutput { 226 return o 227 } 228 229 // The name or description of the Regex Match Set. 230 func (o RegexMatchSetOutput) Name() pulumi.StringOutput { 231 return o.ApplyT(func(v *RegexMatchSet) pulumi.StringOutput { return v.Name }).(pulumi.StringOutput) 232 } 233 234 // The regular expression pattern that you want AWS WAF to search for in web requests, the location in requests that you want AWS WAF to search, and other settings. See below. 235 func (o RegexMatchSetOutput) RegexMatchTuples() RegexMatchSetRegexMatchTupleArrayOutput { 236 return o.ApplyT(func(v *RegexMatchSet) RegexMatchSetRegexMatchTupleArrayOutput { return v.RegexMatchTuples }).(RegexMatchSetRegexMatchTupleArrayOutput) 237 } 238 239 type RegexMatchSetArrayOutput struct{ *pulumi.OutputState } 240 241 func (RegexMatchSetArrayOutput) ElementType() reflect.Type { 242 return reflect.TypeOf((*[]*RegexMatchSet)(nil)).Elem() 243 } 244 245 func (o RegexMatchSetArrayOutput) ToRegexMatchSetArrayOutput() RegexMatchSetArrayOutput { 246 return o 247 } 248 249 func (o RegexMatchSetArrayOutput) ToRegexMatchSetArrayOutputWithContext(ctx context.Context) RegexMatchSetArrayOutput { 250 return o 251 } 252 253 func (o RegexMatchSetArrayOutput) Index(i pulumi.IntInput) RegexMatchSetOutput { 254 return pulumi.All(o, i).ApplyT(func(vs []interface{}) *RegexMatchSet { 255 return vs[0].([]*RegexMatchSet)[vs[1].(int)] 256 }).(RegexMatchSetOutput) 257 } 258 259 type RegexMatchSetMapOutput struct{ *pulumi.OutputState } 260 261 func (RegexMatchSetMapOutput) ElementType() reflect.Type { 262 return reflect.TypeOf((*map[string]*RegexMatchSet)(nil)).Elem() 263 } 264 265 func (o RegexMatchSetMapOutput) ToRegexMatchSetMapOutput() RegexMatchSetMapOutput { 266 return o 267 } 268 269 func (o RegexMatchSetMapOutput) ToRegexMatchSetMapOutputWithContext(ctx context.Context) RegexMatchSetMapOutput { 270 return o 271 } 272 273 func (o RegexMatchSetMapOutput) MapIndex(k pulumi.StringInput) RegexMatchSetOutput { 274 return pulumi.All(o, k).ApplyT(func(vs []interface{}) *RegexMatchSet { 275 return vs[0].(map[string]*RegexMatchSet)[vs[1].(string)] 276 }).(RegexMatchSetOutput) 277 } 278 279 func init() { 280 pulumi.RegisterInputType(reflect.TypeOf((*RegexMatchSetInput)(nil)).Elem(), &RegexMatchSet{}) 281 pulumi.RegisterInputType(reflect.TypeOf((*RegexMatchSetArrayInput)(nil)).Elem(), RegexMatchSetArray{}) 282 pulumi.RegisterInputType(reflect.TypeOf((*RegexMatchSetMapInput)(nil)).Elem(), RegexMatchSetMap{}) 283 pulumi.RegisterOutputType(RegexMatchSetOutput{}) 284 pulumi.RegisterOutputType(RegexMatchSetArrayOutput{}) 285 pulumi.RegisterOutputType(RegexMatchSetMapOutput{}) 286 }