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