| 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 { InsightRuleResource } from "./binding-common.ts"; |
| 5 | |
| 6 | type InsightRules = [InsightRuleResource, ...InsightRuleResource[]]; |
| 7 | |
| 8 | /** |
| 9 | * Runtime binding for `cloudwatch:EnableInsightRules` — resume data |
| 10 | * collection for the bound Contributor Insights rules after they were |
| 11 | * paused with {@link DisableInsightRules}. Bind it to one or more |
| 12 | * {@link InsightRule} resources; the rule names are injected automatically. |
| 13 | * |
| 14 | * Provide `CloudWatch.EnableInsightRulesHttp` on the hosting Lambda |
| 15 | * Function to satisfy the requirement. |
| 16 | * ### Managing Insight Rules |
| 17 | * **Example:** Resume a Contributor Insights Rule |
| 18 | * ```typescript |
| 19 | * // init — grants cloudwatch:EnableInsightRules on the rule |
| 20 | * const enableInsightRules = yield* AWS.CloudWatch.EnableInsightRules(rule); |
| 21 | * |
| 22 | * // runtime |
| 23 | * const result = yield* enableInsightRules(); |
| 24 | * const failures = result.Failures ?? []; // empty on success |
| 25 | * ``` |
| 26 | * |
| 27 | * @binding |
| 28 | */ |
| 29 | export interface EnableInsightRules extends Binding.Service< |
| 30 | EnableInsightRules, |
| 31 | "AWS.CloudWatch.EnableInsightRules", |
| 32 | ( |
| 33 | ...rules: InsightRules |
| 34 | ) => Effect.Effect< |
| 35 | () => Effect.Effect<cloudwatch.EnableInsightRulesOutput, any> |
| 36 | > |
| 37 | > {} |
| 38 | |
| 39 | export const EnableInsightRules = Binding.Service<EnableInsightRules>( |
| 40 | "AWS.CloudWatch.EnableInsightRules", |
| 41 | ); |