github.com/pulumi/pulumi-aws/sdk/v6@v6.32.0/go/aws/waf/regexMatchSet.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 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  //			exampleRegexPatternSet, err := waf.NewRegexPatternSet(ctx, "example", &waf.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  //			_, err = waf.NewRegexMatchSet(ctx, "example", &waf.RegexMatchSetArgs{
    42  //				Name: pulumi.String("example"),
    43  //				RegexMatchTuples: waf.RegexMatchSetRegexMatchTupleArray{
    44  //					&waf.RegexMatchSetRegexMatchTupleArgs{
    45  //						FieldToMatch: &waf.RegexMatchSetRegexMatchTupleFieldToMatchArgs{
    46  //							Data: pulumi.String("User-Agent"),
    47  //							Type: pulumi.String("HEADER"),
    48  //						},
    49  //						RegexPatternSetId:  exampleRegexPatternSet.ID(),
    50  //						TextTransformation: pulumi.String("NONE"),
    51  //					},
    52  //				},
    53  //			})
    54  //			if err != nil {
    55  //				return err
    56  //			}
    57  //			return nil
    58  //		})
    59  //	}
    60  //
    61  // ```
    62  // <!--End PulumiCodeChooser -->
    63  //
    64  // ## Import
    65  //
    66  // Using `pulumi import`, import WAF Regex Match Set using their ID. For example:
    67  //
    68  // ```sh
    69  // $ pulumi import aws:waf/regexMatchSet:RegexMatchSet example a1b2c3d4-d5f6-7777-8888-9999aaaabbbbcccc
    70  // ```
    71  type RegexMatchSet struct {
    72  	pulumi.CustomResourceState
    73  
    74  	// Amazon Resource Name (ARN)
    75  	Arn pulumi.StringOutput `pulumi:"arn"`
    76  	// The name or description of the Regex Match Set.
    77  	Name pulumi.StringOutput `pulumi:"name"`
    78  	// The regular expression pattern that you want AWS WAF to search for in web requests, the location in requests that you want AWS WAF to search, and other settings. See below.
    79  	RegexMatchTuples RegexMatchSetRegexMatchTupleArrayOutput `pulumi:"regexMatchTuples"`
    80  }
    81  
    82  // NewRegexMatchSet registers a new resource with the given unique name, arguments, and options.
    83  func NewRegexMatchSet(ctx *pulumi.Context,
    84  	name string, args *RegexMatchSetArgs, opts ...pulumi.ResourceOption) (*RegexMatchSet, error) {
    85  	if args == nil {
    86  		args = &RegexMatchSetArgs{}
    87  	}
    88  
    89  	opts = internal.PkgResourceDefaultOpts(opts)
    90  	var resource RegexMatchSet
    91  	err := ctx.RegisterResource("aws:waf/regexMatchSet:RegexMatchSet", name, args, &resource, opts...)
    92  	if err != nil {
    93  		return nil, err
    94  	}
    95  	return &resource, nil
    96  }
    97  
    98  // GetRegexMatchSet gets an existing RegexMatchSet resource's state with the given name, ID, and optional
    99  // state properties that are used to uniquely qualify the lookup (nil if not required).
   100  func GetRegexMatchSet(ctx *pulumi.Context,
   101  	name string, id pulumi.IDInput, state *RegexMatchSetState, opts ...pulumi.ResourceOption) (*RegexMatchSet, error) {
   102  	var resource RegexMatchSet
   103  	err := ctx.ReadResource("aws:waf/regexMatchSet:RegexMatchSet", name, id, state, &resource, opts...)
   104  	if err != nil {
   105  		return nil, err
   106  	}
   107  	return &resource, nil
   108  }
   109  
   110  // Input properties used for looking up and filtering RegexMatchSet resources.
   111  type regexMatchSetState struct {
   112  	// Amazon Resource Name (ARN)
   113  	Arn *string `pulumi:"arn"`
   114  	// The name or description of the Regex Match Set.
   115  	Name *string `pulumi:"name"`
   116  	// The regular expression pattern that you want AWS WAF to search for in web requests, the location in requests that you want AWS WAF to search, and other settings. See below.
   117  	RegexMatchTuples []RegexMatchSetRegexMatchTuple `pulumi:"regexMatchTuples"`
   118  }
   119  
   120  type RegexMatchSetState struct {
   121  	// Amazon Resource Name (ARN)
   122  	Arn pulumi.StringPtrInput
   123  	// The name or description of the Regex Match Set.
   124  	Name pulumi.StringPtrInput
   125  	// The regular expression pattern that you want AWS WAF to search for in web requests, the location in requests that you want AWS WAF to search, and other settings. See below.
   126  	RegexMatchTuples RegexMatchSetRegexMatchTupleArrayInput
   127  }
   128  
   129  func (RegexMatchSetState) ElementType() reflect.Type {
   130  	return reflect.TypeOf((*regexMatchSetState)(nil)).Elem()
   131  }
   132  
   133  type regexMatchSetArgs struct {
   134  	// The name or description of the Regex Match Set.
   135  	Name *string `pulumi:"name"`
   136  	// The regular expression pattern that you want AWS WAF to search for in web requests, the location in requests that you want AWS WAF to search, and other settings. See below.
   137  	RegexMatchTuples []RegexMatchSetRegexMatchTuple `pulumi:"regexMatchTuples"`
   138  }
   139  
   140  // The set of arguments for constructing a RegexMatchSet resource.
   141  type RegexMatchSetArgs struct {
   142  	// The name or description of the Regex Match Set.
   143  	Name pulumi.StringPtrInput
   144  	// The regular expression pattern that you want AWS WAF to search for in web requests, the location in requests that you want AWS WAF to search, and other settings. See below.
   145  	RegexMatchTuples RegexMatchSetRegexMatchTupleArrayInput
   146  }
   147  
   148  func (RegexMatchSetArgs) ElementType() reflect.Type {
   149  	return reflect.TypeOf((*regexMatchSetArgs)(nil)).Elem()
   150  }
   151  
   152  type RegexMatchSetInput interface {
   153  	pulumi.Input
   154  
   155  	ToRegexMatchSetOutput() RegexMatchSetOutput
   156  	ToRegexMatchSetOutputWithContext(ctx context.Context) RegexMatchSetOutput
   157  }
   158  
   159  func (*RegexMatchSet) ElementType() reflect.Type {
   160  	return reflect.TypeOf((**RegexMatchSet)(nil)).Elem()
   161  }
   162  
   163  func (i *RegexMatchSet) ToRegexMatchSetOutput() RegexMatchSetOutput {
   164  	return i.ToRegexMatchSetOutputWithContext(context.Background())
   165  }
   166  
   167  func (i *RegexMatchSet) ToRegexMatchSetOutputWithContext(ctx context.Context) RegexMatchSetOutput {
   168  	return pulumi.ToOutputWithContext(ctx, i).(RegexMatchSetOutput)
   169  }
   170  
   171  // RegexMatchSetArrayInput is an input type that accepts RegexMatchSetArray and RegexMatchSetArrayOutput values.
   172  // You can construct a concrete instance of `RegexMatchSetArrayInput` via:
   173  //
   174  //	RegexMatchSetArray{ RegexMatchSetArgs{...} }
   175  type RegexMatchSetArrayInput interface {
   176  	pulumi.Input
   177  
   178  	ToRegexMatchSetArrayOutput() RegexMatchSetArrayOutput
   179  	ToRegexMatchSetArrayOutputWithContext(context.Context) RegexMatchSetArrayOutput
   180  }
   181  
   182  type RegexMatchSetArray []RegexMatchSetInput
   183  
   184  func (RegexMatchSetArray) ElementType() reflect.Type {
   185  	return reflect.TypeOf((*[]*RegexMatchSet)(nil)).Elem()
   186  }
   187  
   188  func (i RegexMatchSetArray) ToRegexMatchSetArrayOutput() RegexMatchSetArrayOutput {
   189  	return i.ToRegexMatchSetArrayOutputWithContext(context.Background())
   190  }
   191  
   192  func (i RegexMatchSetArray) ToRegexMatchSetArrayOutputWithContext(ctx context.Context) RegexMatchSetArrayOutput {
   193  	return pulumi.ToOutputWithContext(ctx, i).(RegexMatchSetArrayOutput)
   194  }
   195  
   196  // RegexMatchSetMapInput is an input type that accepts RegexMatchSetMap and RegexMatchSetMapOutput values.
   197  // You can construct a concrete instance of `RegexMatchSetMapInput` via:
   198  //
   199  //	RegexMatchSetMap{ "key": RegexMatchSetArgs{...} }
   200  type RegexMatchSetMapInput interface {
   201  	pulumi.Input
   202  
   203  	ToRegexMatchSetMapOutput() RegexMatchSetMapOutput
   204  	ToRegexMatchSetMapOutputWithContext(context.Context) RegexMatchSetMapOutput
   205  }
   206  
   207  type RegexMatchSetMap map[string]RegexMatchSetInput
   208  
   209  func (RegexMatchSetMap) ElementType() reflect.Type {
   210  	return reflect.TypeOf((*map[string]*RegexMatchSet)(nil)).Elem()
   211  }
   212  
   213  func (i RegexMatchSetMap) ToRegexMatchSetMapOutput() RegexMatchSetMapOutput {
   214  	return i.ToRegexMatchSetMapOutputWithContext(context.Background())
   215  }
   216  
   217  func (i RegexMatchSetMap) ToRegexMatchSetMapOutputWithContext(ctx context.Context) RegexMatchSetMapOutput {
   218  	return pulumi.ToOutputWithContext(ctx, i).(RegexMatchSetMapOutput)
   219  }
   220  
   221  type RegexMatchSetOutput struct{ *pulumi.OutputState }
   222  
   223  func (RegexMatchSetOutput) ElementType() reflect.Type {
   224  	return reflect.TypeOf((**RegexMatchSet)(nil)).Elem()
   225  }
   226  
   227  func (o RegexMatchSetOutput) ToRegexMatchSetOutput() RegexMatchSetOutput {
   228  	return o
   229  }
   230  
   231  func (o RegexMatchSetOutput) ToRegexMatchSetOutputWithContext(ctx context.Context) RegexMatchSetOutput {
   232  	return o
   233  }
   234  
   235  // Amazon Resource Name (ARN)
   236  func (o RegexMatchSetOutput) Arn() pulumi.StringOutput {
   237  	return o.ApplyT(func(v *RegexMatchSet) pulumi.StringOutput { return v.Arn }).(pulumi.StringOutput)
   238  }
   239  
   240  // The name or description of the Regex Match Set.
   241  func (o RegexMatchSetOutput) Name() pulumi.StringOutput {
   242  	return o.ApplyT(func(v *RegexMatchSet) pulumi.StringOutput { return v.Name }).(pulumi.StringOutput)
   243  }
   244  
   245  // The regular expression pattern that you want AWS WAF to search for in web requests, the location in requests that you want AWS WAF to search, and other settings. See below.
   246  func (o RegexMatchSetOutput) RegexMatchTuples() RegexMatchSetRegexMatchTupleArrayOutput {
   247  	return o.ApplyT(func(v *RegexMatchSet) RegexMatchSetRegexMatchTupleArrayOutput { return v.RegexMatchTuples }).(RegexMatchSetRegexMatchTupleArrayOutput)
   248  }
   249  
   250  type RegexMatchSetArrayOutput struct{ *pulumi.OutputState }
   251  
   252  func (RegexMatchSetArrayOutput) ElementType() reflect.Type {
   253  	return reflect.TypeOf((*[]*RegexMatchSet)(nil)).Elem()
   254  }
   255  
   256  func (o RegexMatchSetArrayOutput) ToRegexMatchSetArrayOutput() RegexMatchSetArrayOutput {
   257  	return o
   258  }
   259  
   260  func (o RegexMatchSetArrayOutput) ToRegexMatchSetArrayOutputWithContext(ctx context.Context) RegexMatchSetArrayOutput {
   261  	return o
   262  }
   263  
   264  func (o RegexMatchSetArrayOutput) Index(i pulumi.IntInput) RegexMatchSetOutput {
   265  	return pulumi.All(o, i).ApplyT(func(vs []interface{}) *RegexMatchSet {
   266  		return vs[0].([]*RegexMatchSet)[vs[1].(int)]
   267  	}).(RegexMatchSetOutput)
   268  }
   269  
   270  type RegexMatchSetMapOutput struct{ *pulumi.OutputState }
   271  
   272  func (RegexMatchSetMapOutput) ElementType() reflect.Type {
   273  	return reflect.TypeOf((*map[string]*RegexMatchSet)(nil)).Elem()
   274  }
   275  
   276  func (o RegexMatchSetMapOutput) ToRegexMatchSetMapOutput() RegexMatchSetMapOutput {
   277  	return o
   278  }
   279  
   280  func (o RegexMatchSetMapOutput) ToRegexMatchSetMapOutputWithContext(ctx context.Context) RegexMatchSetMapOutput {
   281  	return o
   282  }
   283  
   284  func (o RegexMatchSetMapOutput) MapIndex(k pulumi.StringInput) RegexMatchSetOutput {
   285  	return pulumi.All(o, k).ApplyT(func(vs []interface{}) *RegexMatchSet {
   286  		return vs[0].(map[string]*RegexMatchSet)[vs[1].(string)]
   287  	}).(RegexMatchSetOutput)
   288  }
   289  
   290  func init() {
   291  	pulumi.RegisterInputType(reflect.TypeOf((*RegexMatchSetInput)(nil)).Elem(), &RegexMatchSet{})
   292  	pulumi.RegisterInputType(reflect.TypeOf((*RegexMatchSetArrayInput)(nil)).Elem(), RegexMatchSetArray{})
   293  	pulumi.RegisterInputType(reflect.TypeOf((*RegexMatchSetMapInput)(nil)).Elem(), RegexMatchSetMap{})
   294  	pulumi.RegisterOutputType(RegexMatchSetOutput{})
   295  	pulumi.RegisterOutputType(RegexMatchSetArrayOutput{})
   296  	pulumi.RegisterOutputType(RegexMatchSetMapOutput{})
   297  }