github.com/pulumi/pulumi-aws/sdk/v6@v6.32.0/go/aws/wafv2/getRuleGroup.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 Rule Group. 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.LookupRuleGroup(ctx, &wafv2.LookupRuleGroupArgs{ 32 // Name: "some-rule-group", 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 LookupRuleGroup(ctx *pulumi.Context, args *LookupRuleGroupArgs, opts ...pulumi.InvokeOption) (*LookupRuleGroupResult, error) { 45 opts = internal.PkgInvokeDefaultOpts(opts) 46 var rv LookupRuleGroupResult 47 err := ctx.Invoke("aws:wafv2/getRuleGroup:getRuleGroup", 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 getRuleGroup. 55 type LookupRuleGroupArgs struct { 56 // Name of the WAFv2 Rule Group. 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 getRuleGroup. 63 type LookupRuleGroupResult struct { 64 // ARN of the entity. 65 Arn string `pulumi:"arn"` 66 // Description of the rule group 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 Scope string `pulumi:"scope"` 72 } 73 74 func LookupRuleGroupOutput(ctx *pulumi.Context, args LookupRuleGroupOutputArgs, opts ...pulumi.InvokeOption) LookupRuleGroupResultOutput { 75 return pulumi.ToOutputWithContext(context.Background(), args). 76 ApplyT(func(v interface{}) (LookupRuleGroupResult, error) { 77 args := v.(LookupRuleGroupArgs) 78 r, err := LookupRuleGroup(ctx, &args, opts...) 79 var s LookupRuleGroupResult 80 if r != nil { 81 s = *r 82 } 83 return s, err 84 }).(LookupRuleGroupResultOutput) 85 } 86 87 // A collection of arguments for invoking getRuleGroup. 88 type LookupRuleGroupOutputArgs struct { 89 // Name of the WAFv2 Rule Group. 90 Name pulumi.StringInput `pulumi:"name"` 91 // 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. 92 Scope pulumi.StringInput `pulumi:"scope"` 93 } 94 95 func (LookupRuleGroupOutputArgs) ElementType() reflect.Type { 96 return reflect.TypeOf((*LookupRuleGroupArgs)(nil)).Elem() 97 } 98 99 // A collection of values returned by getRuleGroup. 100 type LookupRuleGroupResultOutput struct{ *pulumi.OutputState } 101 102 func (LookupRuleGroupResultOutput) ElementType() reflect.Type { 103 return reflect.TypeOf((*LookupRuleGroupResult)(nil)).Elem() 104 } 105 106 func (o LookupRuleGroupResultOutput) ToLookupRuleGroupResultOutput() LookupRuleGroupResultOutput { 107 return o 108 } 109 110 func (o LookupRuleGroupResultOutput) ToLookupRuleGroupResultOutputWithContext(ctx context.Context) LookupRuleGroupResultOutput { 111 return o 112 } 113 114 // ARN of the entity. 115 func (o LookupRuleGroupResultOutput) Arn() pulumi.StringOutput { 116 return o.ApplyT(func(v LookupRuleGroupResult) string { return v.Arn }).(pulumi.StringOutput) 117 } 118 119 // Description of the rule group that helps with identification. 120 func (o LookupRuleGroupResultOutput) Description() pulumi.StringOutput { 121 return o.ApplyT(func(v LookupRuleGroupResult) string { return v.Description }).(pulumi.StringOutput) 122 } 123 124 // The provider-assigned unique ID for this managed resource. 125 func (o LookupRuleGroupResultOutput) Id() pulumi.StringOutput { 126 return o.ApplyT(func(v LookupRuleGroupResult) string { return v.Id }).(pulumi.StringOutput) 127 } 128 129 func (o LookupRuleGroupResultOutput) Name() pulumi.StringOutput { 130 return o.ApplyT(func(v LookupRuleGroupResult) string { return v.Name }).(pulumi.StringOutput) 131 } 132 133 func (o LookupRuleGroupResultOutput) Scope() pulumi.StringOutput { 134 return o.ApplyT(func(v LookupRuleGroupResult) string { return v.Scope }).(pulumi.StringOutput) 135 } 136 137 func init() { 138 pulumi.RegisterOutputType(LookupRuleGroupResultOutput{}) 139 }