@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 45 lines 1.55 KB
Raw
1 import type * as detective from "@distilled.cloud/aws/detective";
2 import * as Binding from "alchemy/Binding";
3 import type * as Effect from "effect/Effect";
4 import type { Graph } from "./Graph.ts";
5
6 /**
7 * Runtime binding for `detective:StartInvestigation`.
8 *
9 * Kicks off a Detective investigation into an IAM user or role over a time
10 * window — the programmatic version of the console's "Run investigation"
11 * button. A security-automation function can trigger triage the moment a
12 * GuardDuty finding lands. The graph ARN is injected from the bound
13 * {@link Graph}.
14 * Provide the implementation with
15 * `Effect.provide(AWS.Detective.StartInvestigationHttp)`.
16 * ### Running Investigations
17 * **Example:** Investigate A Suspicious Role
18 * ```typescript
19 * // init — bind the operation to the behavior graph
20 * const startInvestigation = yield* AWS.Detective.StartInvestigation(graph);
21 *
22 * // runtime
23 * const { InvestigationId } = yield* startInvestigation({
24 * EntityArn: suspiciousRoleArn,
25 * ScopeStartTime: new Date(Date.now() - 24 * 60 * 60 * 1000),
26 * ScopeEndTime: new Date(),
27 * });
28 * ```
29 *
30 * @binding
31 */
32 export interface StartInvestigation extends Binding.Service<
33 StartInvestigation,
34 "AWS.Detective.StartInvestigation",
35 (
36 graph: Graph,
37 ) => Effect.Effect<
38 (
39 request: Omit<detective.StartInvestigationRequest, "GraphArn">,
40 ) => Effect.Effect<detective.StartInvestigationResponse, detective.StartInvestigationError>
41 >
42 > {}
43 export const StartInvestigation = Binding.Service<StartInvestigation>(
44 "AWS.Detective.StartInvestigation",
45 );