github.com/pulumi/pulumi-aws/sdk/v6@v6.32.0/go/aws/waf/xssMatchSet.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 XSS 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/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.NewXssMatchSet(ctx, "xss_match_set", &waf.XssMatchSetArgs{ 32 // Name: pulumi.String("xss_match_set"), 33 // XssMatchTuples: waf.XssMatchSetXssMatchTupleArray{ 34 // &waf.XssMatchSetXssMatchTupleArgs{ 35 // TextTransformation: pulumi.String("NONE"), 36 // FieldToMatch: &waf.XssMatchSetXssMatchTupleFieldToMatchArgs{ 37 // Type: pulumi.String("URI"), 38 // }, 39 // }, 40 // &waf.XssMatchSetXssMatchTupleArgs{ 41 // TextTransformation: pulumi.String("NONE"), 42 // FieldToMatch: &waf.XssMatchSetXssMatchTupleFieldToMatchArgs{ 43 // Type: pulumi.String("QUERY_STRING"), 44 // }, 45 // }, 46 // }, 47 // }) 48 // if err != nil { 49 // return err 50 // } 51 // return nil 52 // }) 53 // } 54 // 55 // ``` 56 // <!--End PulumiCodeChooser --> 57 // 58 // ## Import 59 // 60 // Using `pulumi import`, import WAF XSS Match Set using their ID. For example: 61 // 62 // ```sh 63 // $ pulumi import aws:waf/xssMatchSet:XssMatchSet example a1b2c3d4-d5f6-7777-8888-9999aaaabbbbcccc 64 // ``` 65 type XssMatchSet struct { 66 pulumi.CustomResourceState 67 68 // Amazon Resource Name (ARN) 69 Arn pulumi.StringOutput `pulumi:"arn"` 70 // The name or description of the SizeConstraintSet. 71 Name pulumi.StringOutput `pulumi:"name"` 72 // The parts of web requests that you want to inspect for cross-site scripting attacks. 73 XssMatchTuples XssMatchSetXssMatchTupleArrayOutput `pulumi:"xssMatchTuples"` 74 } 75 76 // NewXssMatchSet registers a new resource with the given unique name, arguments, and options. 77 func NewXssMatchSet(ctx *pulumi.Context, 78 name string, args *XssMatchSetArgs, opts ...pulumi.ResourceOption) (*XssMatchSet, error) { 79 if args == nil { 80 args = &XssMatchSetArgs{} 81 } 82 83 opts = internal.PkgResourceDefaultOpts(opts) 84 var resource XssMatchSet 85 err := ctx.RegisterResource("aws:waf/xssMatchSet:XssMatchSet", name, args, &resource, opts...) 86 if err != nil { 87 return nil, err 88 } 89 return &resource, nil 90 } 91 92 // GetXssMatchSet gets an existing XssMatchSet resource's state with the given name, ID, and optional 93 // state properties that are used to uniquely qualify the lookup (nil if not required). 94 func GetXssMatchSet(ctx *pulumi.Context, 95 name string, id pulumi.IDInput, state *XssMatchSetState, opts ...pulumi.ResourceOption) (*XssMatchSet, error) { 96 var resource XssMatchSet 97 err := ctx.ReadResource("aws:waf/xssMatchSet:XssMatchSet", name, id, state, &resource, opts...) 98 if err != nil { 99 return nil, err 100 } 101 return &resource, nil 102 } 103 104 // Input properties used for looking up and filtering XssMatchSet resources. 105 type xssMatchSetState struct { 106 // Amazon Resource Name (ARN) 107 Arn *string `pulumi:"arn"` 108 // The name or description of the SizeConstraintSet. 109 Name *string `pulumi:"name"` 110 // The parts of web requests that you want to inspect for cross-site scripting attacks. 111 XssMatchTuples []XssMatchSetXssMatchTuple `pulumi:"xssMatchTuples"` 112 } 113 114 type XssMatchSetState struct { 115 // Amazon Resource Name (ARN) 116 Arn pulumi.StringPtrInput 117 // The name or description of the SizeConstraintSet. 118 Name pulumi.StringPtrInput 119 // The parts of web requests that you want to inspect for cross-site scripting attacks. 120 XssMatchTuples XssMatchSetXssMatchTupleArrayInput 121 } 122 123 func (XssMatchSetState) ElementType() reflect.Type { 124 return reflect.TypeOf((*xssMatchSetState)(nil)).Elem() 125 } 126 127 type xssMatchSetArgs struct { 128 // The name or description of the SizeConstraintSet. 129 Name *string `pulumi:"name"` 130 // The parts of web requests that you want to inspect for cross-site scripting attacks. 131 XssMatchTuples []XssMatchSetXssMatchTuple `pulumi:"xssMatchTuples"` 132 } 133 134 // The set of arguments for constructing a XssMatchSet resource. 135 type XssMatchSetArgs struct { 136 // The name or description of the SizeConstraintSet. 137 Name pulumi.StringPtrInput 138 // The parts of web requests that you want to inspect for cross-site scripting attacks. 139 XssMatchTuples XssMatchSetXssMatchTupleArrayInput 140 } 141 142 func (XssMatchSetArgs) ElementType() reflect.Type { 143 return reflect.TypeOf((*xssMatchSetArgs)(nil)).Elem() 144 } 145 146 type XssMatchSetInput interface { 147 pulumi.Input 148 149 ToXssMatchSetOutput() XssMatchSetOutput 150 ToXssMatchSetOutputWithContext(ctx context.Context) XssMatchSetOutput 151 } 152 153 func (*XssMatchSet) ElementType() reflect.Type { 154 return reflect.TypeOf((**XssMatchSet)(nil)).Elem() 155 } 156 157 func (i *XssMatchSet) ToXssMatchSetOutput() XssMatchSetOutput { 158 return i.ToXssMatchSetOutputWithContext(context.Background()) 159 } 160 161 func (i *XssMatchSet) ToXssMatchSetOutputWithContext(ctx context.Context) XssMatchSetOutput { 162 return pulumi.ToOutputWithContext(ctx, i).(XssMatchSetOutput) 163 } 164 165 // XssMatchSetArrayInput is an input type that accepts XssMatchSetArray and XssMatchSetArrayOutput values. 166 // You can construct a concrete instance of `XssMatchSetArrayInput` via: 167 // 168 // XssMatchSetArray{ XssMatchSetArgs{...} } 169 type XssMatchSetArrayInput interface { 170 pulumi.Input 171 172 ToXssMatchSetArrayOutput() XssMatchSetArrayOutput 173 ToXssMatchSetArrayOutputWithContext(context.Context) XssMatchSetArrayOutput 174 } 175 176 type XssMatchSetArray []XssMatchSetInput 177 178 func (XssMatchSetArray) ElementType() reflect.Type { 179 return reflect.TypeOf((*[]*XssMatchSet)(nil)).Elem() 180 } 181 182 func (i XssMatchSetArray) ToXssMatchSetArrayOutput() XssMatchSetArrayOutput { 183 return i.ToXssMatchSetArrayOutputWithContext(context.Background()) 184 } 185 186 func (i XssMatchSetArray) ToXssMatchSetArrayOutputWithContext(ctx context.Context) XssMatchSetArrayOutput { 187 return pulumi.ToOutputWithContext(ctx, i).(XssMatchSetArrayOutput) 188 } 189 190 // XssMatchSetMapInput is an input type that accepts XssMatchSetMap and XssMatchSetMapOutput values. 191 // You can construct a concrete instance of `XssMatchSetMapInput` via: 192 // 193 // XssMatchSetMap{ "key": XssMatchSetArgs{...} } 194 type XssMatchSetMapInput interface { 195 pulumi.Input 196 197 ToXssMatchSetMapOutput() XssMatchSetMapOutput 198 ToXssMatchSetMapOutputWithContext(context.Context) XssMatchSetMapOutput 199 } 200 201 type XssMatchSetMap map[string]XssMatchSetInput 202 203 func (XssMatchSetMap) ElementType() reflect.Type { 204 return reflect.TypeOf((*map[string]*XssMatchSet)(nil)).Elem() 205 } 206 207 func (i XssMatchSetMap) ToXssMatchSetMapOutput() XssMatchSetMapOutput { 208 return i.ToXssMatchSetMapOutputWithContext(context.Background()) 209 } 210 211 func (i XssMatchSetMap) ToXssMatchSetMapOutputWithContext(ctx context.Context) XssMatchSetMapOutput { 212 return pulumi.ToOutputWithContext(ctx, i).(XssMatchSetMapOutput) 213 } 214 215 type XssMatchSetOutput struct{ *pulumi.OutputState } 216 217 func (XssMatchSetOutput) ElementType() reflect.Type { 218 return reflect.TypeOf((**XssMatchSet)(nil)).Elem() 219 } 220 221 func (o XssMatchSetOutput) ToXssMatchSetOutput() XssMatchSetOutput { 222 return o 223 } 224 225 func (o XssMatchSetOutput) ToXssMatchSetOutputWithContext(ctx context.Context) XssMatchSetOutput { 226 return o 227 } 228 229 // Amazon Resource Name (ARN) 230 func (o XssMatchSetOutput) Arn() pulumi.StringOutput { 231 return o.ApplyT(func(v *XssMatchSet) pulumi.StringOutput { return v.Arn }).(pulumi.StringOutput) 232 } 233 234 // The name or description of the SizeConstraintSet. 235 func (o XssMatchSetOutput) Name() pulumi.StringOutput { 236 return o.ApplyT(func(v *XssMatchSet) pulumi.StringOutput { return v.Name }).(pulumi.StringOutput) 237 } 238 239 // The parts of web requests that you want to inspect for cross-site scripting attacks. 240 func (o XssMatchSetOutput) XssMatchTuples() XssMatchSetXssMatchTupleArrayOutput { 241 return o.ApplyT(func(v *XssMatchSet) XssMatchSetXssMatchTupleArrayOutput { return v.XssMatchTuples }).(XssMatchSetXssMatchTupleArrayOutput) 242 } 243 244 type XssMatchSetArrayOutput struct{ *pulumi.OutputState } 245 246 func (XssMatchSetArrayOutput) ElementType() reflect.Type { 247 return reflect.TypeOf((*[]*XssMatchSet)(nil)).Elem() 248 } 249 250 func (o XssMatchSetArrayOutput) ToXssMatchSetArrayOutput() XssMatchSetArrayOutput { 251 return o 252 } 253 254 func (o XssMatchSetArrayOutput) ToXssMatchSetArrayOutputWithContext(ctx context.Context) XssMatchSetArrayOutput { 255 return o 256 } 257 258 func (o XssMatchSetArrayOutput) Index(i pulumi.IntInput) XssMatchSetOutput { 259 return pulumi.All(o, i).ApplyT(func(vs []interface{}) *XssMatchSet { 260 return vs[0].([]*XssMatchSet)[vs[1].(int)] 261 }).(XssMatchSetOutput) 262 } 263 264 type XssMatchSetMapOutput struct{ *pulumi.OutputState } 265 266 func (XssMatchSetMapOutput) ElementType() reflect.Type { 267 return reflect.TypeOf((*map[string]*XssMatchSet)(nil)).Elem() 268 } 269 270 func (o XssMatchSetMapOutput) ToXssMatchSetMapOutput() XssMatchSetMapOutput { 271 return o 272 } 273 274 func (o XssMatchSetMapOutput) ToXssMatchSetMapOutputWithContext(ctx context.Context) XssMatchSetMapOutput { 275 return o 276 } 277 278 func (o XssMatchSetMapOutput) MapIndex(k pulumi.StringInput) XssMatchSetOutput { 279 return pulumi.All(o, k).ApplyT(func(vs []interface{}) *XssMatchSet { 280 return vs[0].(map[string]*XssMatchSet)[vs[1].(string)] 281 }).(XssMatchSetOutput) 282 } 283 284 func init() { 285 pulumi.RegisterInputType(reflect.TypeOf((*XssMatchSetInput)(nil)).Elem(), &XssMatchSet{}) 286 pulumi.RegisterInputType(reflect.TypeOf((*XssMatchSetArrayInput)(nil)).Elem(), XssMatchSetArray{}) 287 pulumi.RegisterInputType(reflect.TypeOf((*XssMatchSetMapInput)(nil)).Elem(), XssMatchSetMap{}) 288 pulumi.RegisterOutputType(XssMatchSetOutput{}) 289 pulumi.RegisterOutputType(XssMatchSetArrayOutput{}) 290 pulumi.RegisterOutputType(XssMatchSetMapOutput{}) 291 }