Skip to content

GetWebACLForResource

Source: src/AWS/WAFv2/GetWebACLForResource.ts

Runtime binding for wafv2:GetWebACLForResource — look up which web ACL (if any) protects an arbitrary regional resource (ALB, API Gateway stage, AppSync API, Cognito user pool, …). A resource with no web ACL association fails with the typed WAFNonexistentItemException.

Provide WAFv2.GetWebACLForResourceHttp on the hosting Lambda Function to satisfy the requirement.

// init — grants wafv2:GetWebACLForResource + wafv2:GetWebACL
const getWebACLForResource = yield* AWS.WAFv2.GetWebACLForResource();
// runtime
const { WebACL } = yield* getWebACLForResource({
ResourceArn: loadBalancerArn,
});