| 1 | import type * as WAFV2 from "@distilled.cloud/aws/wafv2"; |
| 2 | import type * as Effect from "effect/Effect"; |
| 3 | import * as Binding from "../../Binding.ts"; |
| 4 | |
| 5 | /** |
| 6 | * Runtime binding for `wafv2:GetWebACLForResource` — look up which web ACL |
| 7 | * (if any) protects an arbitrary regional resource (ALB, API Gateway |
| 8 | * stage, AppSync API, Cognito user pool, ...). A resource with no web ACL |
| 9 | * association fails with the typed `WAFNonexistentItemException`. |
| 10 | * |
| 11 | * Provide `WAFv2.GetWebACLForResourceHttp` on the hosting Lambda Function |
| 12 | * to satisfy the requirement. |
| 13 | * ### Inspecting Associations |
| 14 | * **Example:** Look Up the Web ACL Protecting a Load Balancer |
| 15 | * ```typescript |
| 16 | * // init — grants wafv2:GetWebACLForResource + wafv2:GetWebACL |
| 17 | * const getWebACLForResource = yield* AWS.WAFv2.GetWebACLForResource(); |
| 18 | * |
| 19 | * // runtime |
| 20 | * const { WebACL } = yield* getWebACLForResource({ |
| 21 | * ResourceArn: loadBalancerArn, |
| 22 | * }); |
| 23 | * ``` |
| 24 | * |
| 25 | * @binding |
| 26 | */ |
| 27 | export interface GetWebACLForResource extends Binding.Service< |
| 28 | GetWebACLForResource, |
| 29 | "AWS.WAFv2.GetWebACLForResource", |
| 30 | () => Effect.Effect< |
| 31 | ( |
| 32 | request: WAFV2.GetWebACLForResourceRequest, |
| 33 | ) => Effect.Effect< |
| 34 | WAFV2.GetWebACLForResourceResponse, |
| 35 | WAFV2.GetWebACLForResourceError |
| 36 | > |
| 37 | > |
| 38 | > {} |
| 39 | |
| 40 | export const GetWebACLForResource = Binding.Service<GetWebACLForResource>( |
| 41 | "AWS.WAFv2.GetWebACLForResource", |
| 42 | ); |