1. Packages
  2. AWS
  3. API Docs
  4. wafv2
  5. WebAclAssociation
AWS v6.77.0 published on Wednesday, Apr 9, 2025 by Pulumi

aws.wafv2.WebAclAssociation

Explore with Pulumi AI

Creates a WAFv2 Web ACL Association.

NOTE on associating a WAFv2 Web ACL with a Cloudfront distribution: Do not use this resource to associate a WAFv2 Web ACL with a Cloudfront Distribution. The AWS API call backing this resource notes that you should use the web_acl_id property on the cloudfront_distribution instead.

Create WebAclAssociation Resource

Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

Constructor syntax

new WebAclAssociation(name: string, args: WebAclAssociationArgs, opts?: CustomResourceOptions);
@overload
def WebAclAssociation(resource_name: str,
                      args: WebAclAssociationArgs,
                      opts: Optional[ResourceOptions] = None)

@overload
def WebAclAssociation(resource_name: str,
                      opts: Optional[ResourceOptions] = None,
                      resource_arn: Optional[str] = None,
                      web_acl_arn: Optional[str] = None)
func NewWebAclAssociation(ctx *Context, name string, args WebAclAssociationArgs, opts ...ResourceOption) (*WebAclAssociation, error)
public WebAclAssociation(string name, WebAclAssociationArgs args, CustomResourceOptions? opts = null)
public WebAclAssociation(String name, WebAclAssociationArgs args)
public WebAclAssociation(String name, WebAclAssociationArgs args, CustomResourceOptions options)
type: aws:wafv2:WebAclAssociation
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.

Parameters

name This property is required. string
The unique name of the resource.
args This property is required. WebAclAssociationArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name This property is required. str
The unique name of the resource.
args This property is required. WebAclAssociationArgs
The arguments to resource properties.
opts ResourceOptions
Bag of options to control resource's behavior.
ctx Context
Context object for the current deployment.
name This property is required. string
The unique name of the resource.
args This property is required. WebAclAssociationArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name This property is required. string
The unique name of the resource.
args This property is required. WebAclAssociationArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
name This property is required. String
The unique name of the resource.
args This property is required. WebAclAssociationArgs
The arguments to resource properties.
options CustomResourceOptions
Bag of options to control resource's behavior.

Constructor example

The following reference example uses placeholder values for all input properties.

var awsWebAclAssociationResource = new Aws.WafV2.WebAclAssociation("awsWebAclAssociationResource", new()
{
    ResourceArn = "string",
    WebAclArn = "string",
});
Copy
example, err := wafv2.NewWebAclAssociation(ctx, "awsWebAclAssociationResource", &wafv2.WebAclAssociationArgs{
	ResourceArn: pulumi.String("string"),
	WebAclArn:   pulumi.String("string"),
})
Copy
var awsWebAclAssociationResource = new WebAclAssociation("awsWebAclAssociationResource", WebAclAssociationArgs.builder()
    .resourceArn("string")
    .webAclArn("string")
    .build());
Copy
aws_web_acl_association_resource = aws.wafv2.WebAclAssociation("awsWebAclAssociationResource",
    resource_arn="string",
    web_acl_arn="string")
Copy
const awsWebAclAssociationResource = new aws.wafv2.WebAclAssociation("awsWebAclAssociationResource", {
    resourceArn: "string",
    webAclArn: "string",
});
Copy
type: aws:wafv2:WebAclAssociation
properties:
    resourceArn: string
    webAclArn: string
Copy

WebAclAssociation Resource Properties

To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

Inputs

In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.

The WebAclAssociation resource accepts the following input properties:

ResourceArn
This property is required.
Changes to this property will trigger replacement.
string
The Amazon Resource Name (ARN) of the resource to associate with the web ACL. This must be an ARN of an Application Load Balancer, an Amazon API Gateway stage (REST only, HTTP is unsupported), an Amazon Cognito User Pool, an Amazon AppSync GraphQL API, an Amazon App Runner service, or an Amazon Verified Access instance.
WebAclArn
This property is required.
Changes to this property will trigger replacement.
string
The Amazon Resource Name (ARN) of the Web ACL that you want to associate with the resource.
ResourceArn
This property is required.
Changes to this property will trigger replacement.
string
The Amazon Resource Name (ARN) of the resource to associate with the web ACL. This must be an ARN of an Application Load Balancer, an Amazon API Gateway stage (REST only, HTTP is unsupported), an Amazon Cognito User Pool, an Amazon AppSync GraphQL API, an Amazon App Runner service, or an Amazon Verified Access instance.
WebAclArn
This property is required.
Changes to this property will trigger replacement.
string
The Amazon Resource Name (ARN) of the Web ACL that you want to associate with the resource.
resourceArn
This property is required.
Changes to this property will trigger replacement.
String
The Amazon Resource Name (ARN) of the resource to associate with the web ACL. This must be an ARN of an Application Load Balancer, an Amazon API Gateway stage (REST only, HTTP is unsupported), an Amazon Cognito User Pool, an Amazon AppSync GraphQL API, an Amazon App Runner service, or an Amazon Verified Access instance.
webAclArn
This property is required.
Changes to this property will trigger replacement.
String
The Amazon Resource Name (ARN) of the Web ACL that you want to associate with the resource.
resourceArn
This property is required.
Changes to this property will trigger replacement.
string
The Amazon Resource Name (ARN) of the resource to associate with the web ACL. This must be an ARN of an Application Load Balancer, an Amazon API Gateway stage (REST only, HTTP is unsupported), an Amazon Cognito User Pool, an Amazon AppSync GraphQL API, an Amazon App Runner service, or an Amazon Verified Access instance.
webAclArn
This property is required.
Changes to this property will trigger replacement.
string
The Amazon Resource Name (ARN) of the Web ACL that you want to associate with the resource.
resource_arn
This property is required.
Changes to this property will trigger replacement.
str
The Amazon Resource Name (ARN) of the resource to associate with the web ACL. This must be an ARN of an Application Load Balancer, an Amazon API Gateway stage (REST only, HTTP is unsupported), an Amazon Cognito User Pool, an Amazon AppSync GraphQL API, an Amazon App Runner service, or an Amazon Verified Access instance.
web_acl_arn
This property is required.
Changes to this property will trigger replacement.
str
The Amazon Resource Name (ARN) of the Web ACL that you want to associate with the resource.
resourceArn
This property is required.
Changes to this property will trigger replacement.
String
The Amazon Resource Name (ARN) of the resource to associate with the web ACL. This must be an ARN of an Application Load Balancer, an Amazon API Gateway stage (REST only, HTTP is unsupported), an Amazon Cognito User Pool, an Amazon AppSync GraphQL API, an Amazon App Runner service, or an Amazon Verified Access instance.
webAclArn
This property is required.
Changes to this property will trigger replacement.
String
The Amazon Resource Name (ARN) of the Web ACL that you want to associate with the resource.

Outputs

All input properties are implicitly available as output properties. Additionally, the WebAclAssociation resource produces the following output properties:

Id string
The provider-assigned unique ID for this managed resource.
Id string
The provider-assigned unique ID for this managed resource.
id String
The provider-assigned unique ID for this managed resource.
id string
The provider-assigned unique ID for this managed resource.
id str
The provider-assigned unique ID for this managed resource.
id String
The provider-assigned unique ID for this managed resource.

Look up Existing WebAclAssociation Resource

Get an existing WebAclAssociation resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

public static get(name: string, id: Input<ID>, state?: WebAclAssociationState, opts?: CustomResourceOptions): WebAclAssociation
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        resource_arn: Optional[str] = None,
        web_acl_arn: Optional[str] = None) -> WebAclAssociation
func GetWebAclAssociation(ctx *Context, name string, id IDInput, state *WebAclAssociationState, opts ...ResourceOption) (*WebAclAssociation, error)
public static WebAclAssociation Get(string name, Input<string> id, WebAclAssociationState? state, CustomResourceOptions? opts = null)
public static WebAclAssociation get(String name, Output<String> id, WebAclAssociationState state, CustomResourceOptions options)
resources:  _:    type: aws:wafv2:WebAclAssociation    get:      id: ${id}
name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
resource_name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
The following state arguments are supported:
ResourceArn Changes to this property will trigger replacement. string
The Amazon Resource Name (ARN) of the resource to associate with the web ACL. This must be an ARN of an Application Load Balancer, an Amazon API Gateway stage (REST only, HTTP is unsupported), an Amazon Cognito User Pool, an Amazon AppSync GraphQL API, an Amazon App Runner service, or an Amazon Verified Access instance.
WebAclArn Changes to this property will trigger replacement. string
The Amazon Resource Name (ARN) of the Web ACL that you want to associate with the resource.
ResourceArn Changes to this property will trigger replacement. string
The Amazon Resource Name (ARN) of the resource to associate with the web ACL. This must be an ARN of an Application Load Balancer, an Amazon API Gateway stage (REST only, HTTP is unsupported), an Amazon Cognito User Pool, an Amazon AppSync GraphQL API, an Amazon App Runner service, or an Amazon Verified Access instance.
WebAclArn Changes to this property will trigger replacement. string
The Amazon Resource Name (ARN) of the Web ACL that you want to associate with the resource.
resourceArn Changes to this property will trigger replacement. String
The Amazon Resource Name (ARN) of the resource to associate with the web ACL. This must be an ARN of an Application Load Balancer, an Amazon API Gateway stage (REST only, HTTP is unsupported), an Amazon Cognito User Pool, an Amazon AppSync GraphQL API, an Amazon App Runner service, or an Amazon Verified Access instance.
webAclArn Changes to this property will trigger replacement. String
The Amazon Resource Name (ARN) of the Web ACL that you want to associate with the resource.
resourceArn Changes to this property will trigger replacement. string
The Amazon Resource Name (ARN) of the resource to associate with the web ACL. This must be an ARN of an Application Load Balancer, an Amazon API Gateway stage (REST only, HTTP is unsupported), an Amazon Cognito User Pool, an Amazon AppSync GraphQL API, an Amazon App Runner service, or an Amazon Verified Access instance.
webAclArn Changes to this property will trigger replacement. string
The Amazon Resource Name (ARN) of the Web ACL that you want to associate with the resource.
resource_arn Changes to this property will trigger replacement. str
The Amazon Resource Name (ARN) of the resource to associate with the web ACL. This must be an ARN of an Application Load Balancer, an Amazon API Gateway stage (REST only, HTTP is unsupported), an Amazon Cognito User Pool, an Amazon AppSync GraphQL API, an Amazon App Runner service, or an Amazon Verified Access instance.
web_acl_arn Changes to this property will trigger replacement. str
The Amazon Resource Name (ARN) of the Web ACL that you want to associate with the resource.
resourceArn Changes to this property will trigger replacement. String
The Amazon Resource Name (ARN) of the resource to associate with the web ACL. This must be an ARN of an Application Load Balancer, an Amazon API Gateway stage (REST only, HTTP is unsupported), an Amazon Cognito User Pool, an Amazon AppSync GraphQL API, an Amazon App Runner service, or an Amazon Verified Access instance.
webAclArn Changes to this property will trigger replacement. String
The Amazon Resource Name (ARN) of the Web ACL that you want to associate with the resource.

Import

Using pulumi import, import WAFv2 Web ACL Association using WEB_ACL_ARN,RESOURCE_ARN. For example:

$ pulumi import aws:wafv2/webAclAssociation:WebAclAssociation example arn:aws:wafv2:...7ce849ea,arn:aws:apigateway:...ages/name
Copy

To learn more about importing existing cloud resources, see Importing resources.

Package Details

Repository
AWS Classic pulumi/pulumi-aws
License
Apache-2.0
Notes
This Pulumi package is based on the aws Terraform Provider.