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