# CfnWebACLAssociationProps

Properties for defining a `CfnWebACLAssociation`.

Used as props by: [CfnWebACLAssociation](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_wafv2.CfnWebACLAssociation.html)

- Source: Generated at build time
- Type last changed: v2.227.0 · 21 Nov 2025

## Example

TypeScript:

```ts
declare const api: appsync.EventApi;
declare const webAcl: wafv2.CfnWebACL;

// Associate waf with Event API
new wafv2.CfnWebACLAssociation(this, 'WafAssociation', {
  resourceArn: api.apiArn,
  webAclArn: webAcl.attrArn,
});
```

Python:

```python
# api: appsync.EventApi
# web_acl: wafv2.CfnWebACL

# Associate waf with Event API
wafv2.CfnWebACLAssociation(self, "WafAssociation",
    resource_arn=api.api_arn,
    web_acl_arn=web_acl.attr_arn
)
```

Java:

```java
EventApi api;
CfnWebACL webAcl;

// Associate waf with Event API
// Associate waf with Event API
CfnWebACLAssociation.Builder.create(this, "WafAssociation")
        .resourceArn(api.getApiArn())
        .webAclArn(webAcl.getAttrArn())
        .build();
```

C# / .NET:

```csharp
// Install: dotnet add package Amazon.CDK.Lib
EventApi api;
CfnWebACL webAcl;

// Associate waf with Event API
// Associate waf with Event API
new CfnWebACLAssociation(this, "WafAssociation", new CfnWebACLAssociationProps {
    ResourceArn = api.ApiArn,
    WebAclArn = webAcl.AttrArn
});
```

Golang:

```go
// Install: go get github.com/aws/aws-cdk-go/awscdk/v2
var api EventApi
var webAcl CfnWebACL

// Associate waf with Event API
// Associate waf with Event API
wafv2.NewCfnWebACLAssociation(this, jsii.String("WafAssociation"), &CfnWebACLAssociationProps{
	ResourceArn: api.ApiArn,
	WebAclArn: webAcl.attrArn,
})
```

## Properties

- `resourceArn`: string | [IGraphQLApiRef](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.interfaces.aws_appsync.IGraphQLApiRef.html) | [ILoadBalancerRef](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.interfaces.aws_elasticloadbalancingv2.ILoadBalancerRef.html) | [IWebACLRef](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.interfaces.aws_wafv2.IWebACLRef.html) (required) — The Amazon Resource Name (ARN) of the resource to associate with the web ACL.

  The ARN must be in one of the following formats:

  - For an Application Load Balancer: `arn: *partition* :elasticloadbalancing: *region* : *account-id* :loadbalancer/app/ *load-balancer-name* / *load-balancer-id*`
  - For an Amazon API Gateway REST API: `arn: *partition* :apigateway: *region* ::/restapis/ *api-id* /stages/ *stage-name*`
  - For an AWS AppSync GraphQL API: `arn: *partition* :appsync: *region* : *account-id* :apis/ *GraphQLApiId*`
  - For an Amazon Cognito user pool: `arn: *partition* :cognito-idp: *region* : *account-id* :userpool/ *user-pool-id*`
  - For an AWS App Runner service: `arn: *partition* :apprunner: *region* : *account-id* :service/ *apprunner-service-name* / *apprunner-service-id*`
  - For an AWS Verified Access instance: `arn: *partition* :ec2: *region* : *account-id* :verified-access-instance/ *instance-id*`
  - For an AWS Amplify instance: `arn: *partition* :amplify: *region* : *account-id* :apps/ *app-id*`

- `webAclArn`: string (required) — The Amazon Resource Name (ARN) of the web ACL that you want to associate with the resource.
