@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 53 lines 1.73 KB
Raw
1 import type * as config from "@distilled.cloud/aws/config-service";
2 import * as Binding from "alchemy/Binding";
3 import type * as Effect from "effect/Effect";
4 import type { ConfigRule } from "./ConfigRule.ts";
5
6 /** Request for {@link PutExternalEvaluation} — the rule name is injected from the bound rule. */
7 export interface PutExternalEvaluationRequest extends Omit<
8 config.PutExternalEvaluationRequest,
9 "ConfigRuleName"
10 > {}
11
12 /**
13 * Runtime binding for `config:PutExternalEvaluation` — push an externally
14 * computed compliance verdict for one resource into the bound
15 * {@link ConfigRule} (the rule must use the external evaluation mode); the
16 * rule name is injected automatically.
17 *
18 * Provide `Config.PutExternalEvaluationHttp` on the hosting Lambda Function
19 * to satisfy the requirement.
20 * ### Reporting Evaluations (Custom Rules)
21 * **Example:** Push an External Evaluation
22 * ```typescript
23 * // init — grants config:PutExternalEvaluation
24 * const putExternalEvaluation = yield* AWS.Config.PutExternalEvaluation(rule);
25 *
26 * // runtime
27 * yield* putExternalEvaluation({
28 * ExternalEvaluation: {
29 * ComplianceResourceType: "AWS::S3::Bucket",
30 * ComplianceResourceId: "my-bucket",
31 * ComplianceType: "COMPLIANT",
32 * OrderingTimestamp: new Date(),
33 * },
34 * });
35 * ```
36 *
37 * @binding
38 */
39 export interface PutExternalEvaluation extends Binding.Service<
40 PutExternalEvaluation,
41 "AWS.Config.PutExternalEvaluation",
42 (
43 rule: ConfigRule,
44 ) => Effect.Effect<
45 (
46 request: PutExternalEvaluationRequest,
47 ) => Effect.Effect<config.PutExternalEvaluationResponse, config.PutExternalEvaluationError>
48 >
49 > {}
50
51 export const PutExternalEvaluation = Binding.Service<PutExternalEvaluation>(
52 "AWS.Config.PutExternalEvaluation",
53 );