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