github.com/pulumi/pulumi-aws/sdk/v6@v6.32.0/go/aws/wafregional/regexPatternSet.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 Pattern 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 // _, 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 // return nil 42 // }) 43 // } 44 // 45 // ``` 46 // <!--End PulumiCodeChooser --> 47 // 48 // ## Import 49 // 50 // Using `pulumi import`, import WAF Regional Regex Pattern Set using the id. For example: 51 // 52 // ```sh 53 // $ pulumi import aws:wafregional/regexPatternSet:RegexPatternSet example a1b2c3d4-d5f6-7777-8888-9999aaaabbbbcccc 54 // ``` 55 type RegexPatternSet struct { 56 pulumi.CustomResourceState 57 58 // The name or description of the Regex Pattern Set. 59 Name pulumi.StringOutput `pulumi:"name"` 60 // A list of regular expression (regex) patterns that you want AWS WAF to search for, such as `B[a@]dB[o0]t`. 61 RegexPatternStrings pulumi.StringArrayOutput `pulumi:"regexPatternStrings"` 62 } 63 64 // NewRegexPatternSet registers a new resource with the given unique name, arguments, and options. 65 func NewRegexPatternSet(ctx *pulumi.Context, 66 name string, args *RegexPatternSetArgs, opts ...pulumi.ResourceOption) (*RegexPatternSet, error) { 67 if args == nil { 68 args = &RegexPatternSetArgs{} 69 } 70 71 opts = internal.PkgResourceDefaultOpts(opts) 72 var resource RegexPatternSet 73 err := ctx.RegisterResource("aws:wafregional/regexPatternSet:RegexPatternSet", name, args, &resource, opts...) 74 if err != nil { 75 return nil, err 76 } 77 return &resource, nil 78 } 79 80 // GetRegexPatternSet gets an existing RegexPatternSet resource's state with the given name, ID, and optional 81 // state properties that are used to uniquely qualify the lookup (nil if not required). 82 func GetRegexPatternSet(ctx *pulumi.Context, 83 name string, id pulumi.IDInput, state *RegexPatternSetState, opts ...pulumi.ResourceOption) (*RegexPatternSet, error) { 84 var resource RegexPatternSet 85 err := ctx.ReadResource("aws:wafregional/regexPatternSet:RegexPatternSet", name, id, state, &resource, opts...) 86 if err != nil { 87 return nil, err 88 } 89 return &resource, nil 90 } 91 92 // Input properties used for looking up and filtering RegexPatternSet resources. 93 type regexPatternSetState struct { 94 // The name or description of the Regex Pattern Set. 95 Name *string `pulumi:"name"` 96 // A list of regular expression (regex) patterns that you want AWS WAF to search for, such as `B[a@]dB[o0]t`. 97 RegexPatternStrings []string `pulumi:"regexPatternStrings"` 98 } 99 100 type RegexPatternSetState struct { 101 // The name or description of the Regex Pattern Set. 102 Name pulumi.StringPtrInput 103 // A list of regular expression (regex) patterns that you want AWS WAF to search for, such as `B[a@]dB[o0]t`. 104 RegexPatternStrings pulumi.StringArrayInput 105 } 106 107 func (RegexPatternSetState) ElementType() reflect.Type { 108 return reflect.TypeOf((*regexPatternSetState)(nil)).Elem() 109 } 110 111 type regexPatternSetArgs struct { 112 // The name or description of the Regex Pattern Set. 113 Name *string `pulumi:"name"` 114 // A list of regular expression (regex) patterns that you want AWS WAF to search for, such as `B[a@]dB[o0]t`. 115 RegexPatternStrings []string `pulumi:"regexPatternStrings"` 116 } 117 118 // The set of arguments for constructing a RegexPatternSet resource. 119 type RegexPatternSetArgs struct { 120 // The name or description of the Regex Pattern Set. 121 Name pulumi.StringPtrInput 122 // A list of regular expression (regex) patterns that you want AWS WAF to search for, such as `B[a@]dB[o0]t`. 123 RegexPatternStrings pulumi.StringArrayInput 124 } 125 126 func (RegexPatternSetArgs) ElementType() reflect.Type { 127 return reflect.TypeOf((*regexPatternSetArgs)(nil)).Elem() 128 } 129 130 type RegexPatternSetInput interface { 131 pulumi.Input 132 133 ToRegexPatternSetOutput() RegexPatternSetOutput 134 ToRegexPatternSetOutputWithContext(ctx context.Context) RegexPatternSetOutput 135 } 136 137 func (*RegexPatternSet) ElementType() reflect.Type { 138 return reflect.TypeOf((**RegexPatternSet)(nil)).Elem() 139 } 140 141 func (i *RegexPatternSet) ToRegexPatternSetOutput() RegexPatternSetOutput { 142 return i.ToRegexPatternSetOutputWithContext(context.Background()) 143 } 144 145 func (i *RegexPatternSet) ToRegexPatternSetOutputWithContext(ctx context.Context) RegexPatternSetOutput { 146 return pulumi.ToOutputWithContext(ctx, i).(RegexPatternSetOutput) 147 } 148 149 // RegexPatternSetArrayInput is an input type that accepts RegexPatternSetArray and RegexPatternSetArrayOutput values. 150 // You can construct a concrete instance of `RegexPatternSetArrayInput` via: 151 // 152 // RegexPatternSetArray{ RegexPatternSetArgs{...} } 153 type RegexPatternSetArrayInput interface { 154 pulumi.Input 155 156 ToRegexPatternSetArrayOutput() RegexPatternSetArrayOutput 157 ToRegexPatternSetArrayOutputWithContext(context.Context) RegexPatternSetArrayOutput 158 } 159 160 type RegexPatternSetArray []RegexPatternSetInput 161 162 func (RegexPatternSetArray) ElementType() reflect.Type { 163 return reflect.TypeOf((*[]*RegexPatternSet)(nil)).Elem() 164 } 165 166 func (i RegexPatternSetArray) ToRegexPatternSetArrayOutput() RegexPatternSetArrayOutput { 167 return i.ToRegexPatternSetArrayOutputWithContext(context.Background()) 168 } 169 170 func (i RegexPatternSetArray) ToRegexPatternSetArrayOutputWithContext(ctx context.Context) RegexPatternSetArrayOutput { 171 return pulumi.ToOutputWithContext(ctx, i).(RegexPatternSetArrayOutput) 172 } 173 174 // RegexPatternSetMapInput is an input type that accepts RegexPatternSetMap and RegexPatternSetMapOutput values. 175 // You can construct a concrete instance of `RegexPatternSetMapInput` via: 176 // 177 // RegexPatternSetMap{ "key": RegexPatternSetArgs{...} } 178 type RegexPatternSetMapInput interface { 179 pulumi.Input 180 181 ToRegexPatternSetMapOutput() RegexPatternSetMapOutput 182 ToRegexPatternSetMapOutputWithContext(context.Context) RegexPatternSetMapOutput 183 } 184 185 type RegexPatternSetMap map[string]RegexPatternSetInput 186 187 func (RegexPatternSetMap) ElementType() reflect.Type { 188 return reflect.TypeOf((*map[string]*RegexPatternSet)(nil)).Elem() 189 } 190 191 func (i RegexPatternSetMap) ToRegexPatternSetMapOutput() RegexPatternSetMapOutput { 192 return i.ToRegexPatternSetMapOutputWithContext(context.Background()) 193 } 194 195 func (i RegexPatternSetMap) ToRegexPatternSetMapOutputWithContext(ctx context.Context) RegexPatternSetMapOutput { 196 return pulumi.ToOutputWithContext(ctx, i).(RegexPatternSetMapOutput) 197 } 198 199 type RegexPatternSetOutput struct{ *pulumi.OutputState } 200 201 func (RegexPatternSetOutput) ElementType() reflect.Type { 202 return reflect.TypeOf((**RegexPatternSet)(nil)).Elem() 203 } 204 205 func (o RegexPatternSetOutput) ToRegexPatternSetOutput() RegexPatternSetOutput { 206 return o 207 } 208 209 func (o RegexPatternSetOutput) ToRegexPatternSetOutputWithContext(ctx context.Context) RegexPatternSetOutput { 210 return o 211 } 212 213 // The name or description of the Regex Pattern Set. 214 func (o RegexPatternSetOutput) Name() pulumi.StringOutput { 215 return o.ApplyT(func(v *RegexPatternSet) pulumi.StringOutput { return v.Name }).(pulumi.StringOutput) 216 } 217 218 // A list of regular expression (regex) patterns that you want AWS WAF to search for, such as `B[a@]dB[o0]t`. 219 func (o RegexPatternSetOutput) RegexPatternStrings() pulumi.StringArrayOutput { 220 return o.ApplyT(func(v *RegexPatternSet) pulumi.StringArrayOutput { return v.RegexPatternStrings }).(pulumi.StringArrayOutput) 221 } 222 223 type RegexPatternSetArrayOutput struct{ *pulumi.OutputState } 224 225 func (RegexPatternSetArrayOutput) ElementType() reflect.Type { 226 return reflect.TypeOf((*[]*RegexPatternSet)(nil)).Elem() 227 } 228 229 func (o RegexPatternSetArrayOutput) ToRegexPatternSetArrayOutput() RegexPatternSetArrayOutput { 230 return o 231 } 232 233 func (o RegexPatternSetArrayOutput) ToRegexPatternSetArrayOutputWithContext(ctx context.Context) RegexPatternSetArrayOutput { 234 return o 235 } 236 237 func (o RegexPatternSetArrayOutput) Index(i pulumi.IntInput) RegexPatternSetOutput { 238 return pulumi.All(o, i).ApplyT(func(vs []interface{}) *RegexPatternSet { 239 return vs[0].([]*RegexPatternSet)[vs[1].(int)] 240 }).(RegexPatternSetOutput) 241 } 242 243 type RegexPatternSetMapOutput struct{ *pulumi.OutputState } 244 245 func (RegexPatternSetMapOutput) ElementType() reflect.Type { 246 return reflect.TypeOf((*map[string]*RegexPatternSet)(nil)).Elem() 247 } 248 249 func (o RegexPatternSetMapOutput) ToRegexPatternSetMapOutput() RegexPatternSetMapOutput { 250 return o 251 } 252 253 func (o RegexPatternSetMapOutput) ToRegexPatternSetMapOutputWithContext(ctx context.Context) RegexPatternSetMapOutput { 254 return o 255 } 256 257 func (o RegexPatternSetMapOutput) MapIndex(k pulumi.StringInput) RegexPatternSetOutput { 258 return pulumi.All(o, k).ApplyT(func(vs []interface{}) *RegexPatternSet { 259 return vs[0].(map[string]*RegexPatternSet)[vs[1].(string)] 260 }).(RegexPatternSetOutput) 261 } 262 263 func init() { 264 pulumi.RegisterInputType(reflect.TypeOf((*RegexPatternSetInput)(nil)).Elem(), &RegexPatternSet{}) 265 pulumi.RegisterInputType(reflect.TypeOf((*RegexPatternSetArrayInput)(nil)).Elem(), RegexPatternSetArray{}) 266 pulumi.RegisterInputType(reflect.TypeOf((*RegexPatternSetMapInput)(nil)).Elem(), RegexPatternSetMap{}) 267 pulumi.RegisterOutputType(RegexPatternSetOutput{}) 268 pulumi.RegisterOutputType(RegexPatternSetArrayOutput{}) 269 pulumi.RegisterOutputType(RegexPatternSetMapOutput{}) 270 }