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

main
ts 39 lines 1.31 KB
Raw
1 import * as cloudwatch from "@distilled.cloud/aws/cloudwatch";
2 import * as Binding from "alchemy/Binding";
3 import * as Effect from "effect/Effect";
4 import type { MetricStream } from "./MetricStream.ts";
5
6 type MetricStreams = [MetricStream, ...MetricStream[]];
7
8 /**
9 * Runtime binding for `cloudwatch:StopMetricStreams` — pause streaming for
10 * the bound metric streams (e.g. to control Firehose cost during an
11 * incident). Resume with {@link StartMetricStreams}. Bind it to one or more
12 * {@link MetricStream} resources; the stream names are injected
13 * automatically.
14 *
15 * Provide `CloudWatch.StopMetricStreamsHttp` on the hosting Lambda
16 * Function to satisfy the requirement.
17 * ### Managing Metric Streams
18 * **Example:** Pause a Metric Stream
19 * ```typescript
20 * // init — grants cloudwatch:StopMetricStreams on the stream
21 * const stopMetricStreams = yield* AWS.CloudWatch.StopMetricStreams(stream);
22 *
23 * // runtime
24 * yield* stopMetricStreams();
25 * ```
26 *
27 * @binding
28 */
29 export interface StopMetricStreams extends Binding.Service<
30 StopMetricStreams,
31 "AWS.CloudWatch.StopMetricStreams",
32 (
33 ...streams: MetricStreams
34 ) => Effect.Effect<() => Effect.Effect<cloudwatch.StopMetricStreamsOutput, any>>
35 > {}
36
37 export const StopMetricStreams = Binding.Service<StopMetricStreams>(
38 "AWS.CloudWatch.StopMetricStreams",
39 );