github.com/pulumi/pulumi-aws/sdk/v6@v6.32.0/go/aws/wafregional/byteMatchSet.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 Byte Match Set Resource for use with Application Load Balancer. 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.NewByteMatchSet(ctx, "byte_set", &wafregional.ByteMatchSetArgs{ 32 // Name: pulumi.String("my_waf_byte_match_set"), 33 // ByteMatchTuples: wafregional.ByteMatchSetByteMatchTupleArray{ 34 // &wafregional.ByteMatchSetByteMatchTupleArgs{ 35 // TextTransformation: pulumi.String("NONE"), 36 // TargetString: pulumi.String("badrefer1"), 37 // PositionalConstraint: pulumi.String("CONTAINS"), 38 // FieldToMatch: &wafregional.ByteMatchSetByteMatchTupleFieldToMatchArgs{ 39 // Type: pulumi.String("HEADER"), 40 // Data: pulumi.String("referer"), 41 // }, 42 // }, 43 // }, 44 // }) 45 // if err != nil { 46 // return err 47 // } 48 // return nil 49 // }) 50 // } 51 // 52 // ``` 53 // <!--End PulumiCodeChooser --> 54 // 55 // ## Import 56 // 57 // Using `pulumi import`, import WAF Regional Byte Match Set using the id. For example: 58 // 59 // ```sh 60 // $ pulumi import aws:wafregional/byteMatchSet:ByteMatchSet byte_set a1b2c3d4-d5f6-7777-8888-9999aaaabbbbcccc 61 // ``` 62 type ByteMatchSet struct { 63 pulumi.CustomResourceState 64 65 // Settings for the ByteMatchSet, such as the bytes (typically a string that corresponds with ASCII characters) that you want AWS WAF to search for in web requests. ByteMatchTuple documented below. 66 ByteMatchTuples ByteMatchSetByteMatchTupleArrayOutput `pulumi:"byteMatchTuples"` 67 // The name or description of the ByteMatchSet. 68 Name pulumi.StringOutput `pulumi:"name"` 69 } 70 71 // NewByteMatchSet registers a new resource with the given unique name, arguments, and options. 72 func NewByteMatchSet(ctx *pulumi.Context, 73 name string, args *ByteMatchSetArgs, opts ...pulumi.ResourceOption) (*ByteMatchSet, error) { 74 if args == nil { 75 args = &ByteMatchSetArgs{} 76 } 77 78 opts = internal.PkgResourceDefaultOpts(opts) 79 var resource ByteMatchSet 80 err := ctx.RegisterResource("aws:wafregional/byteMatchSet:ByteMatchSet", name, args, &resource, opts...) 81 if err != nil { 82 return nil, err 83 } 84 return &resource, nil 85 } 86 87 // GetByteMatchSet gets an existing ByteMatchSet resource's state with the given name, ID, and optional 88 // state properties that are used to uniquely qualify the lookup (nil if not required). 89 func GetByteMatchSet(ctx *pulumi.Context, 90 name string, id pulumi.IDInput, state *ByteMatchSetState, opts ...pulumi.ResourceOption) (*ByteMatchSet, error) { 91 var resource ByteMatchSet 92 err := ctx.ReadResource("aws:wafregional/byteMatchSet:ByteMatchSet", name, id, state, &resource, opts...) 93 if err != nil { 94 return nil, err 95 } 96 return &resource, nil 97 } 98 99 // Input properties used for looking up and filtering ByteMatchSet resources. 100 type byteMatchSetState struct { 101 // Settings for the ByteMatchSet, such as the bytes (typically a string that corresponds with ASCII characters) that you want AWS WAF to search for in web requests. ByteMatchTuple documented below. 102 ByteMatchTuples []ByteMatchSetByteMatchTuple `pulumi:"byteMatchTuples"` 103 // The name or description of the ByteMatchSet. 104 Name *string `pulumi:"name"` 105 } 106 107 type ByteMatchSetState struct { 108 // Settings for the ByteMatchSet, such as the bytes (typically a string that corresponds with ASCII characters) that you want AWS WAF to search for in web requests. ByteMatchTuple documented below. 109 ByteMatchTuples ByteMatchSetByteMatchTupleArrayInput 110 // The name or description of the ByteMatchSet. 111 Name pulumi.StringPtrInput 112 } 113 114 func (ByteMatchSetState) ElementType() reflect.Type { 115 return reflect.TypeOf((*byteMatchSetState)(nil)).Elem() 116 } 117 118 type byteMatchSetArgs struct { 119 // Settings for the ByteMatchSet, such as the bytes (typically a string that corresponds with ASCII characters) that you want AWS WAF to search for in web requests. ByteMatchTuple documented below. 120 ByteMatchTuples []ByteMatchSetByteMatchTuple `pulumi:"byteMatchTuples"` 121 // The name or description of the ByteMatchSet. 122 Name *string `pulumi:"name"` 123 } 124 125 // The set of arguments for constructing a ByteMatchSet resource. 126 type ByteMatchSetArgs struct { 127 // Settings for the ByteMatchSet, such as the bytes (typically a string that corresponds with ASCII characters) that you want AWS WAF to search for in web requests. ByteMatchTuple documented below. 128 ByteMatchTuples ByteMatchSetByteMatchTupleArrayInput 129 // The name or description of the ByteMatchSet. 130 Name pulumi.StringPtrInput 131 } 132 133 func (ByteMatchSetArgs) ElementType() reflect.Type { 134 return reflect.TypeOf((*byteMatchSetArgs)(nil)).Elem() 135 } 136 137 type ByteMatchSetInput interface { 138 pulumi.Input 139 140 ToByteMatchSetOutput() ByteMatchSetOutput 141 ToByteMatchSetOutputWithContext(ctx context.Context) ByteMatchSetOutput 142 } 143 144 func (*ByteMatchSet) ElementType() reflect.Type { 145 return reflect.TypeOf((**ByteMatchSet)(nil)).Elem() 146 } 147 148 func (i *ByteMatchSet) ToByteMatchSetOutput() ByteMatchSetOutput { 149 return i.ToByteMatchSetOutputWithContext(context.Background()) 150 } 151 152 func (i *ByteMatchSet) ToByteMatchSetOutputWithContext(ctx context.Context) ByteMatchSetOutput { 153 return pulumi.ToOutputWithContext(ctx, i).(ByteMatchSetOutput) 154 } 155 156 // ByteMatchSetArrayInput is an input type that accepts ByteMatchSetArray and ByteMatchSetArrayOutput values. 157 // You can construct a concrete instance of `ByteMatchSetArrayInput` via: 158 // 159 // ByteMatchSetArray{ ByteMatchSetArgs{...} } 160 type ByteMatchSetArrayInput interface { 161 pulumi.Input 162 163 ToByteMatchSetArrayOutput() ByteMatchSetArrayOutput 164 ToByteMatchSetArrayOutputWithContext(context.Context) ByteMatchSetArrayOutput 165 } 166 167 type ByteMatchSetArray []ByteMatchSetInput 168 169 func (ByteMatchSetArray) ElementType() reflect.Type { 170 return reflect.TypeOf((*[]*ByteMatchSet)(nil)).Elem() 171 } 172 173 func (i ByteMatchSetArray) ToByteMatchSetArrayOutput() ByteMatchSetArrayOutput { 174 return i.ToByteMatchSetArrayOutputWithContext(context.Background()) 175 } 176 177 func (i ByteMatchSetArray) ToByteMatchSetArrayOutputWithContext(ctx context.Context) ByteMatchSetArrayOutput { 178 return pulumi.ToOutputWithContext(ctx, i).(ByteMatchSetArrayOutput) 179 } 180 181 // ByteMatchSetMapInput is an input type that accepts ByteMatchSetMap and ByteMatchSetMapOutput values. 182 // You can construct a concrete instance of `ByteMatchSetMapInput` via: 183 // 184 // ByteMatchSetMap{ "key": ByteMatchSetArgs{...} } 185 type ByteMatchSetMapInput interface { 186 pulumi.Input 187 188 ToByteMatchSetMapOutput() ByteMatchSetMapOutput 189 ToByteMatchSetMapOutputWithContext(context.Context) ByteMatchSetMapOutput 190 } 191 192 type ByteMatchSetMap map[string]ByteMatchSetInput 193 194 func (ByteMatchSetMap) ElementType() reflect.Type { 195 return reflect.TypeOf((*map[string]*ByteMatchSet)(nil)).Elem() 196 } 197 198 func (i ByteMatchSetMap) ToByteMatchSetMapOutput() ByteMatchSetMapOutput { 199 return i.ToByteMatchSetMapOutputWithContext(context.Background()) 200 } 201 202 func (i ByteMatchSetMap) ToByteMatchSetMapOutputWithContext(ctx context.Context) ByteMatchSetMapOutput { 203 return pulumi.ToOutputWithContext(ctx, i).(ByteMatchSetMapOutput) 204 } 205 206 type ByteMatchSetOutput struct{ *pulumi.OutputState } 207 208 func (ByteMatchSetOutput) ElementType() reflect.Type { 209 return reflect.TypeOf((**ByteMatchSet)(nil)).Elem() 210 } 211 212 func (o ByteMatchSetOutput) ToByteMatchSetOutput() ByteMatchSetOutput { 213 return o 214 } 215 216 func (o ByteMatchSetOutput) ToByteMatchSetOutputWithContext(ctx context.Context) ByteMatchSetOutput { 217 return o 218 } 219 220 // Settings for the ByteMatchSet, such as the bytes (typically a string that corresponds with ASCII characters) that you want AWS WAF to search for in web requests. ByteMatchTuple documented below. 221 func (o ByteMatchSetOutput) ByteMatchTuples() ByteMatchSetByteMatchTupleArrayOutput { 222 return o.ApplyT(func(v *ByteMatchSet) ByteMatchSetByteMatchTupleArrayOutput { return v.ByteMatchTuples }).(ByteMatchSetByteMatchTupleArrayOutput) 223 } 224 225 // The name or description of the ByteMatchSet. 226 func (o ByteMatchSetOutput) Name() pulumi.StringOutput { 227 return o.ApplyT(func(v *ByteMatchSet) pulumi.StringOutput { return v.Name }).(pulumi.StringOutput) 228 } 229 230 type ByteMatchSetArrayOutput struct{ *pulumi.OutputState } 231 232 func (ByteMatchSetArrayOutput) ElementType() reflect.Type { 233 return reflect.TypeOf((*[]*ByteMatchSet)(nil)).Elem() 234 } 235 236 func (o ByteMatchSetArrayOutput) ToByteMatchSetArrayOutput() ByteMatchSetArrayOutput { 237 return o 238 } 239 240 func (o ByteMatchSetArrayOutput) ToByteMatchSetArrayOutputWithContext(ctx context.Context) ByteMatchSetArrayOutput { 241 return o 242 } 243 244 func (o ByteMatchSetArrayOutput) Index(i pulumi.IntInput) ByteMatchSetOutput { 245 return pulumi.All(o, i).ApplyT(func(vs []interface{}) *ByteMatchSet { 246 return vs[0].([]*ByteMatchSet)[vs[1].(int)] 247 }).(ByteMatchSetOutput) 248 } 249 250 type ByteMatchSetMapOutput struct{ *pulumi.OutputState } 251 252 func (ByteMatchSetMapOutput) ElementType() reflect.Type { 253 return reflect.TypeOf((*map[string]*ByteMatchSet)(nil)).Elem() 254 } 255 256 func (o ByteMatchSetMapOutput) ToByteMatchSetMapOutput() ByteMatchSetMapOutput { 257 return o 258 } 259 260 func (o ByteMatchSetMapOutput) ToByteMatchSetMapOutputWithContext(ctx context.Context) ByteMatchSetMapOutput { 261 return o 262 } 263 264 func (o ByteMatchSetMapOutput) MapIndex(k pulumi.StringInput) ByteMatchSetOutput { 265 return pulumi.All(o, k).ApplyT(func(vs []interface{}) *ByteMatchSet { 266 return vs[0].(map[string]*ByteMatchSet)[vs[1].(string)] 267 }).(ByteMatchSetOutput) 268 } 269 270 func init() { 271 pulumi.RegisterInputType(reflect.TypeOf((*ByteMatchSetInput)(nil)).Elem(), &ByteMatchSet{}) 272 pulumi.RegisterInputType(reflect.TypeOf((*ByteMatchSetArrayInput)(nil)).Elem(), ByteMatchSetArray{}) 273 pulumi.RegisterInputType(reflect.TypeOf((*ByteMatchSetMapInput)(nil)).Elem(), ByteMatchSetMap{}) 274 pulumi.RegisterOutputType(ByteMatchSetOutput{}) 275 pulumi.RegisterOutputType(ByteMatchSetArrayOutput{}) 276 pulumi.RegisterOutputType(ByteMatchSetMapOutput{}) 277 }