1import type * as WAFV2 from "@distilled.cloud/aws/wafv2";
2import type * as Effect from "effect/Effect";
3import * as Binding from "../../Binding.ts";
4import type { WebACL } from "./WebACL.ts";
5
6export interface GetRateBasedStatementManagedKeysRequest extends Omit<
7 WAFV2.GetRateBasedStatementManagedKeysRequest,
8 "Scope" | "WebACLName" | "WebACLId"
9> {}
10
11/**
12 * Runtime binding for `wafv2:GetRateBasedStatementManagedKeys` — read the
13 * IP addresses that a rate-based rule of the bound {@link WebACL} is
14 * currently blocking; the web ACL name, id, and scope are injected
15 * automatically.
16 *
17 * Provide `WAFv2.GetRateBasedStatementManagedKeysHttp` on the hosting
18 * Lambda Function to satisfy the requirement.
19 * ### Inspecting Traffic
20 * **Example:** Read the Currently Rate-Limited Addresses
21 * ```typescript
22 * // init — grants wafv2:GetRateBasedStatementManagedKeys on the web ACL
23 * const getManagedKeys = yield* AWS.WAFv2.GetRateBasedStatementManagedKeys(acl);
24 *
25 * // runtime
26 * const { ManagedKeysIPV4 } = yield* getManagedKeys({ RuleName: "rate-limit" });
27 * const blocked = ManagedKeysIPV4?.Addresses ?? [];
28 * ```
29 *
30 * @binding
31 */
32export interface GetRateBasedStatementManagedKeys extends Binding.Service<
33 GetRateBasedStatementManagedKeys,
34 "AWS.WAFv2.GetRateBasedStatementManagedKeys",
35 (
36 webAcl: WebACL,
37 ) => Effect.Effect<
38 (
39 request: GetRateBasedStatementManagedKeysRequest,
40 ) => Effect.Effect<
41 WAFV2.GetRateBasedStatementManagedKeysResponse,
42 WAFV2.GetRateBasedStatementManagedKeysError
43 >
44 >
45> {}
46
47export const GetRateBasedStatementManagedKeys =
48 Binding.Service<GetRateBasedStatementManagedKeys>(
49 "AWS.WAFv2.GetRateBasedStatementManagedKeys",
50 );