@devries-cameron20 / t3code Mirror · read-only
Fork 0

The best way to control Claude Code, Codex and more from any computer or phone

Mirrored from https://github.com/Camo67/t3code.git

Synced Nov 21, 06:00 UTC

main
ts 42 lines 1.38 KB
Raw
1 import type * as WAFV2 from "@distilled.cloud/aws/wafv2";
2 import * as Binding from "alchemy/Binding";
3 import type * as Effect from "effect/Effect";
4 import type { RuleGroup } from "./RuleGroup.ts";
5
6 /**
7 * Runtime binding for `wafv2:GetPermissionPolicy` — read the IAM policy
8 * that shares the bound {@link RuleGroup} with other accounts; the rule
9 * group ARN is injected automatically. A rule group with no policy
10 * attached fails with the typed `WAFNonexistentItemException`.
11 *
12 * Provide `WAFv2.GetPermissionPolicyHttp` on the hosting Lambda Function to
13 * satisfy the requirement.
14 * ### Sharing Rule Groups
15 * **Example:** Read the Sharing Policy
16 * ```typescript
17 * // init — grants wafv2:GetPermissionPolicy on the rule group
18 * const getPermissionPolicy = yield* AWS.WAFv2.GetPermissionPolicy(group);
19 *
20 * // runtime
21 * const { Policy } = yield* getPermissionPolicy().pipe(
22 * Effect.catchTag("WAFNonexistentItemException", () =>
23 * Effect.succeed({ Policy: undefined }),
24 * ),
25 * );
26 * ```
27 *
28 * @binding
29 */
30 export interface GetPermissionPolicy extends Binding.Service<
31 GetPermissionPolicy,
32 "AWS.WAFv2.GetPermissionPolicy",
33 (
34 ruleGroup: RuleGroup,
35 ) => Effect.Effect<
36 () => Effect.Effect<WAFV2.GetPermissionPolicyResponse, WAFV2.GetPermissionPolicyError>
37 >
38 > {}
39
40 export const GetPermissionPolicy = Binding.Service<GetPermissionPolicy>(
41 "AWS.WAFv2.GetPermissionPolicy",
42 );