1. Packages
  2. AWS
  3. API Docs
  4. wafv2
  5. getWebAcl
AWS v7.5.0 published on Wednesday, Aug 20, 2025 by Pulumi

aws.wafv2.getWebAcl

Explore with Pulumi AI

aws logo
AWS v7.5.0 published on Wednesday, Aug 20, 2025 by Pulumi

    Retrieves the summary of a WAFv2 Web ACL.

    Example Usage

    Lookup by name

    import * as pulumi from "@pulumi/pulumi";
    import * as aws from "@pulumi/aws";
    
    const example = aws.wafv2.getWebAcl({
        name: "some-web-acl",
        scope: "REGIONAL",
    });
    
    import pulumi
    import pulumi_aws as aws
    
    example = aws.wafv2.get_web_acl(name="some-web-acl",
        scope="REGIONAL")
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-aws/sdk/v7/go/aws/wafv2"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := wafv2.LookupWebAcl(ctx, &wafv2.LookupWebAclArgs{
    			Name:  pulumi.StringRef("some-web-acl"),
    			Scope: "REGIONAL",
    		}, nil)
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Aws = Pulumi.Aws;
    
    return await Deployment.RunAsync(() => 
    {
        var example = Aws.WafV2.GetWebAcl.Invoke(new()
        {
            Name = "some-web-acl",
            Scope = "REGIONAL",
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.aws.wafv2.Wafv2Functions;
    import com.pulumi.aws.wafv2.inputs.GetWebAclArgs;
    import java.util.List;
    import java.util.ArrayList;
    import java.util.Map;
    import java.io.File;
    import java.nio.file.Files;
    import java.nio.file.Paths;
    
    public class App {
        public static void main(String[] args) {
            Pulumi.run(App::stack);
        }
    
        public static void stack(Context ctx) {
            final var example = Wafv2Functions.getWebAcl(GetWebAclArgs.builder()
                .name("some-web-acl")
                .scope("REGIONAL")
                .build());
    
        }
    }
    
    variables:
      example:
        fn::invoke:
          function: aws:wafv2:getWebAcl
          arguments:
            name: some-web-acl
            scope: REGIONAL
    

    Lookup by associated resource

    import * as pulumi from "@pulumi/pulumi";
    import * as aws from "@pulumi/aws";
    
    const albExample = aws.wafv2.getWebAcl({
        resourceArn: "arn:aws:elasticloadbalancing:us-east-1:123456789012:loadbalancer/app/my-alb/xxxxx",
        scope: "REGIONAL",
    });
    const cloudfrontExample = aws.wafv2.getWebAcl({
        resourceArn: "arn:aws:cloudfront::123456789012:distribution/XXX",
        scope: "CLOUDFRONT",
    });
    
    import pulumi
    import pulumi_aws as aws
    
    alb_example = aws.wafv2.get_web_acl(resource_arn="arn:aws:elasticloadbalancing:us-east-1:123456789012:loadbalancer/app/my-alb/xxxxx",
        scope="REGIONAL")
    cloudfront_example = aws.wafv2.get_web_acl(resource_arn="arn:aws:cloudfront::123456789012:distribution/XXX",
        scope="CLOUDFRONT")
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-aws/sdk/v7/go/aws/wafv2"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := wafv2.LookupWebAcl(ctx, &wafv2.LookupWebAclArgs{
    			ResourceArn: pulumi.StringRef("arn:aws:elasticloadbalancing:us-east-1:123456789012:loadbalancer/app/my-alb/xxxxx"),
    			Scope:       "REGIONAL",
    		}, nil)
    		if err != nil {
    			return err
    		}
    		_, err = wafv2.LookupWebAcl(ctx, &wafv2.LookupWebAclArgs{
    			ResourceArn: pulumi.StringRef("arn:aws:cloudfront::123456789012:distribution/XXX"),
    			Scope:       "CLOUDFRONT",
    		}, nil)
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Aws = Pulumi.Aws;
    
    return await Deployment.RunAsync(() => 
    {
        var albExample = Aws.WafV2.GetWebAcl.Invoke(new()
        {
            ResourceArn = "arn:aws:elasticloadbalancing:us-east-1:123456789012:loadbalancer/app/my-alb/xxxxx",
            Scope = "REGIONAL",
        });
    
        var cloudfrontExample = Aws.WafV2.GetWebAcl.Invoke(new()
        {
            ResourceArn = "arn:aws:cloudfront::123456789012:distribution/XXX",
            Scope = "CLOUDFRONT",
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.aws.wafv2.Wafv2Functions;
    import com.pulumi.aws.wafv2.inputs.GetWebAclArgs;
    import java.util.List;
    import java.util.ArrayList;
    import java.util.Map;
    import java.io.File;
    import java.nio.file.Files;
    import java.nio.file.Paths;
    
    public class App {
        public static void main(String[] args) {
            Pulumi.run(App::stack);
        }
    
        public static void stack(Context ctx) {
            final var albExample = Wafv2Functions.getWebAcl(GetWebAclArgs.builder()
                .resourceArn("arn:aws:elasticloadbalancing:us-east-1:123456789012:loadbalancer/app/my-alb/xxxxx")
                .scope("REGIONAL")
                .build());
    
            final var cloudfrontExample = Wafv2Functions.getWebAcl(GetWebAclArgs.builder()
                .resourceArn("arn:aws:cloudfront::123456789012:distribution/XXX")
                .scope("CLOUDFRONT")
                .build());
    
        }
    }
    
    variables:
      albExample:
        fn::invoke:
          function: aws:wafv2:getWebAcl
          arguments:
            resourceArn: arn:aws:elasticloadbalancing:us-east-1:123456789012:loadbalancer/app/my-alb/xxxxx
            scope: REGIONAL
      cloudfrontExample:
        fn::invoke:
          function: aws:wafv2:getWebAcl
          arguments:
            resourceArn: arn:aws:cloudfront::123456789012:distribution/XXX
            scope: CLOUDFRONT
    

    Using getWebAcl

    Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.

    function getWebAcl(args: GetWebAclArgs, opts?: InvokeOptions): Promise<GetWebAclResult>
    function getWebAclOutput(args: GetWebAclOutputArgs, opts?: InvokeOptions): Output<GetWebAclResult>
    def get_web_acl(name: Optional[str] = None,
                    region: Optional[str] = None,
                    resource_arn: Optional[str] = None,
                    scope: Optional[str] = None,
                    opts: Optional[InvokeOptions] = None) -> GetWebAclResult
    def get_web_acl_output(name: Optional[pulumi.Input[str]] = None,
                    region: Optional[pulumi.Input[str]] = None,
                    resource_arn: Optional[pulumi.Input[str]] = None,
                    scope: Optional[pulumi.Input[str]] = None,
                    opts: Optional[InvokeOptions] = None) -> Output[GetWebAclResult]
    func LookupWebAcl(ctx *Context, args *LookupWebAclArgs, opts ...InvokeOption) (*LookupWebAclResult, error)
    func LookupWebAclOutput(ctx *Context, args *LookupWebAclOutputArgs, opts ...InvokeOption) LookupWebAclResultOutput

    > Note: This function is named LookupWebAcl in the Go SDK.

    public static class GetWebAcl 
    {
        public static Task<GetWebAclResult> InvokeAsync(GetWebAclArgs args, InvokeOptions? opts = null)
        public static Output<GetWebAclResult> Invoke(GetWebAclInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetWebAclResult> getWebAcl(GetWebAclArgs args, InvokeOptions options)
    public static Output<GetWebAclResult> getWebAcl(GetWebAclArgs args, InvokeOptions options)
    
    fn::invoke:
      function: aws:wafv2/getWebAcl:getWebAcl
      arguments:
        # arguments dictionary

    The following arguments are supported:

    Scope string
    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.
    Name string
    Name of the WAFv2 Web ACL. Exactly one of name or resource_arn must be specified.
    Region string
    Region where this resource will be managed. Defaults to the Region set in the provider configuration.
    ResourceArn string
    ARN of the AWS resource associated with the Web ACL. This can be an ARN of an Application Load Balancer, Amazon API Gateway REST API, AWS AppSync GraphQL API, Amazon Cognito user pool, AWS App Runner service, AWS Verified Access instance, or AWS Amplify application. Exactly one of name or resource_arn must be specified.
    Scope string
    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.
    Name string
    Name of the WAFv2 Web ACL. Exactly one of name or resource_arn must be specified.
    Region string
    Region where this resource will be managed. Defaults to the Region set in the provider configuration.
    ResourceArn string
    ARN of the AWS resource associated with the Web ACL. This can be an ARN of an Application Load Balancer, Amazon API Gateway REST API, AWS AppSync GraphQL API, Amazon Cognito user pool, AWS App Runner service, AWS Verified Access instance, or AWS Amplify application. Exactly one of name or resource_arn must be specified.
    scope String
    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.
    name String
    Name of the WAFv2 Web ACL. Exactly one of name or resource_arn must be specified.
    region String
    Region where this resource will be managed. Defaults to the Region set in the provider configuration.
    resourceArn String
    ARN of the AWS resource associated with the Web ACL. This can be an ARN of an Application Load Balancer, Amazon API Gateway REST API, AWS AppSync GraphQL API, Amazon Cognito user pool, AWS App Runner service, AWS Verified Access instance, or AWS Amplify application. Exactly one of name or resource_arn must be specified.
    scope string
    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.
    name string
    Name of the WAFv2 Web ACL. Exactly one of name or resource_arn must be specified.
    region string
    Region where this resource will be managed. Defaults to the Region set in the provider configuration.
    resourceArn string
    ARN of the AWS resource associated with the Web ACL. This can be an ARN of an Application Load Balancer, Amazon API Gateway REST API, AWS AppSync GraphQL API, Amazon Cognito user pool, AWS App Runner service, AWS Verified Access instance, or AWS Amplify application. Exactly one of name or resource_arn must be specified.
    scope str
    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.
    name str
    Name of the WAFv2 Web ACL. Exactly one of name or resource_arn must be specified.
    region str
    Region where this resource will be managed. Defaults to the Region set in the provider configuration.
    resource_arn str
    ARN of the AWS resource associated with the Web ACL. This can be an ARN of an Application Load Balancer, Amazon API Gateway REST API, AWS AppSync GraphQL API, Amazon Cognito user pool, AWS App Runner service, AWS Verified Access instance, or AWS Amplify application. Exactly one of name or resource_arn must be specified.
    scope String
    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.
    name String
    Name of the WAFv2 Web ACL. Exactly one of name or resource_arn must be specified.
    region String
    Region where this resource will be managed. Defaults to the Region set in the provider configuration.
    resourceArn String
    ARN of the AWS resource associated with the Web ACL. This can be an ARN of an Application Load Balancer, Amazon API Gateway REST API, AWS AppSync GraphQL API, Amazon Cognito user pool, AWS App Runner service, AWS Verified Access instance, or AWS Amplify application. Exactly one of name or resource_arn must be specified.

    getWebAcl Result

    The following output properties are available:

    Arn string
    ARN of the entity.
    Description string
    Description of the WebACL that helps with identification.
    Id string
    The provider-assigned unique ID for this managed resource.
    Region string
    Scope string
    Name string
    ResourceArn string
    Arn string
    ARN of the entity.
    Description string
    Description of the WebACL that helps with identification.
    Id string
    The provider-assigned unique ID for this managed resource.
    Region string
    Scope string
    Name string
    ResourceArn string
    arn String
    ARN of the entity.
    description String
    Description of the WebACL that helps with identification.
    id String
    The provider-assigned unique ID for this managed resource.
    region String
    scope String
    name String
    resourceArn String
    arn string
    ARN of the entity.
    description string
    Description of the WebACL that helps with identification.
    id string
    The provider-assigned unique ID for this managed resource.
    region string
    scope string
    name string
    resourceArn string
    arn str
    ARN of the entity.
    description str
    Description of the WebACL that helps with identification.
    id str
    The provider-assigned unique ID for this managed resource.
    region str
    scope str
    name str
    resource_arn str
    arn String
    ARN of the entity.
    description String
    Description of the WebACL that helps with identification.
    id String
    The provider-assigned unique ID for this managed resource.
    region String
    scope String
    name String
    resourceArn String

    Package Details

    Repository
    AWS Classic pulumi/pulumi-aws
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the aws Terraform Provider.
    aws logo
    AWS v7.5.0 published on Wednesday, Aug 20, 2025 by Pulumi