Skip to content

GetRateBasedStatementManagedKeys

Source: src/AWS/WAFv2/GetRateBasedStatementManagedKeys.ts

Runtime binding for wafv2:GetRateBasedStatementManagedKeys — read the IP addresses that a rate-based rule of the bound WebACL is currently blocking; the web ACL name, id, and scope are injected automatically.

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

// init — grants wafv2:GetRateBasedStatementManagedKeys on the web ACL
const getManagedKeys = yield* AWS.WAFv2.GetRateBasedStatementManagedKeys(acl);
// runtime
const { ManagedKeysIPV4 } = yield* getManagedKeys({ RuleName: "rate-limit" });
const blocked = ManagedKeysIPV4?.Addresses ?? [];