github.com/pulumi/pulumi-aws/sdk/v6@v6.32.0/go/aws/wafv2/getRegexPatternSet.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 wafv2 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 // Retrieves the summary of a WAFv2 Regex Pattern Set. 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/wafv2" 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 := wafv2.LookupRegexPatternSet(ctx, &wafv2.LookupRegexPatternSetArgs{ 32 // Name: "some-regex-pattern-set", 33 // Scope: "REGIONAL", 34 // }, nil) 35 // if err != nil { 36 // return err 37 // } 38 // return nil 39 // }) 40 // } 41 // 42 // ``` 43 // <!--End PulumiCodeChooser --> 44 func LookupRegexPatternSet(ctx *pulumi.Context, args *LookupRegexPatternSetArgs, opts ...pulumi.InvokeOption) (*LookupRegexPatternSetResult, error) { 45 opts = internal.PkgInvokeDefaultOpts(opts) 46 var rv LookupRegexPatternSetResult 47 err := ctx.Invoke("aws:wafv2/getRegexPatternSet:getRegexPatternSet", args, &rv, opts...) 48 if err != nil { 49 return nil, err 50 } 51 return &rv, nil 52 } 53 54 // A collection of arguments for invoking getRegexPatternSet. 55 type LookupRegexPatternSetArgs struct { 56 // Name of the WAFv2 Regex Pattern Set. 57 Name string `pulumi:"name"` 58 // Specifies whether this is for an AWS CloudFront distribution or for a regional application. Valid values are `CLOUDFRONT` or `REGIONAL`. To work with CloudFront, you must also specify the region `us-east-1` (N. Virginia) on the AWS provider. 59 Scope string `pulumi:"scope"` 60 } 61 62 // A collection of values returned by getRegexPatternSet. 63 type LookupRegexPatternSetResult struct { 64 // ARN of the entity. 65 Arn string `pulumi:"arn"` 66 // Description of the set that helps with identification. 67 Description string `pulumi:"description"` 68 // The provider-assigned unique ID for this managed resource. 69 Id string `pulumi:"id"` 70 Name string `pulumi:"name"` 71 // One or more blocks of regular expression patterns that AWS WAF is searching for. See Regular Expression below for details. 72 RegularExpressions []GetRegexPatternSetRegularExpression `pulumi:"regularExpressions"` 73 Scope string `pulumi:"scope"` 74 } 75 76 func LookupRegexPatternSetOutput(ctx *pulumi.Context, args LookupRegexPatternSetOutputArgs, opts ...pulumi.InvokeOption) LookupRegexPatternSetResultOutput { 77 return pulumi.ToOutputWithContext(context.Background(), args). 78 ApplyT(func(v interface{}) (LookupRegexPatternSetResult, error) { 79 args := v.(LookupRegexPatternSetArgs) 80 r, err := LookupRegexPatternSet(ctx, &args, opts...) 81 var s LookupRegexPatternSetResult 82 if r != nil { 83 s = *r 84 } 85 return s, err 86 }).(LookupRegexPatternSetResultOutput) 87 } 88 89 // A collection of arguments for invoking getRegexPatternSet. 90 type LookupRegexPatternSetOutputArgs struct { 91 // Name of the WAFv2 Regex Pattern Set. 92 Name pulumi.StringInput `pulumi:"name"` 93 // Specifies whether this is for an AWS CloudFront distribution or for a regional application. Valid values are `CLOUDFRONT` or `REGIONAL`. To work with CloudFront, you must also specify the region `us-east-1` (N. Virginia) on the AWS provider. 94 Scope pulumi.StringInput `pulumi:"scope"` 95 } 96 97 func (LookupRegexPatternSetOutputArgs) ElementType() reflect.Type { 98 return reflect.TypeOf((*LookupRegexPatternSetArgs)(nil)).Elem() 99 } 100 101 // A collection of values returned by getRegexPatternSet. 102 type LookupRegexPatternSetResultOutput struct{ *pulumi.OutputState } 103 104 func (LookupRegexPatternSetResultOutput) ElementType() reflect.Type { 105 return reflect.TypeOf((*LookupRegexPatternSetResult)(nil)).Elem() 106 } 107 108 func (o LookupRegexPatternSetResultOutput) ToLookupRegexPatternSetResultOutput() LookupRegexPatternSetResultOutput { 109 return o 110 } 111 112 func (o LookupRegexPatternSetResultOutput) ToLookupRegexPatternSetResultOutputWithContext(ctx context.Context) LookupRegexPatternSetResultOutput { 113 return o 114 } 115 116 // ARN of the entity. 117 func (o LookupRegexPatternSetResultOutput) Arn() pulumi.StringOutput { 118 return o.ApplyT(func(v LookupRegexPatternSetResult) string { return v.Arn }).(pulumi.StringOutput) 119 } 120 121 // Description of the set that helps with identification. 122 func (o LookupRegexPatternSetResultOutput) Description() pulumi.StringOutput { 123 return o.ApplyT(func(v LookupRegexPatternSetResult) string { return v.Description }).(pulumi.StringOutput) 124 } 125 126 // The provider-assigned unique ID for this managed resource. 127 func (o LookupRegexPatternSetResultOutput) Id() pulumi.StringOutput { 128 return o.ApplyT(func(v LookupRegexPatternSetResult) string { return v.Id }).(pulumi.StringOutput) 129 } 130 131 func (o LookupRegexPatternSetResultOutput) Name() pulumi.StringOutput { 132 return o.ApplyT(func(v LookupRegexPatternSetResult) string { return v.Name }).(pulumi.StringOutput) 133 } 134 135 // One or more blocks of regular expression patterns that AWS WAF is searching for. See Regular Expression below for details. 136 func (o LookupRegexPatternSetResultOutput) RegularExpressions() GetRegexPatternSetRegularExpressionArrayOutput { 137 return o.ApplyT(func(v LookupRegexPatternSetResult) []GetRegexPatternSetRegularExpression { return v.RegularExpressions }).(GetRegexPatternSetRegularExpressionArrayOutput) 138 } 139 140 func (o LookupRegexPatternSetResultOutput) Scope() pulumi.StringOutput { 141 return o.ApplyT(func(v LookupRegexPatternSetResult) string { return v.Scope }).(pulumi.StringOutput) 142 } 143 144 func init() { 145 pulumi.RegisterOutputType(LookupRegexPatternSetResultOutput{}) 146 }