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