Skip to content

CheckCapacity

Source: src/AWS/WAFv2/CheckCapacity.ts

Runtime binding for wafv2:CheckCapacity — compute the web ACL capacity units (WCU) a set of rules would consume, e.g. before updating an IP set or constructing rules dynamically.

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

// init — grants wafv2:CheckCapacity
const checkCapacity = yield* AWS.WAFv2.CheckCapacity();
// runtime
const { Capacity } = yield* checkCapacity({
Scope: "REGIONAL",
Rules: [rule],
});