| 1 | import type * as controltower from "@distilled.cloud/aws/controltower"; |
| 2 | import type * as Effect from "effect/Effect"; |
| 3 | import * as Binding from "../../Binding.ts"; |
| 4 | import type { EnabledControl } from "./EnabledControl.ts"; |
| 5 | |
| 6 | /** |
| 7 | * Runtime binding for `controltower:ResetEnabledControl`. |
| 8 | * |
| 9 | * Bind this operation to an {@link EnabledControl} to re-deploy the |
| 10 | * guardrail's governance resources from inside a function runtime — |
| 11 | * remediating drift without changing the enablement's configuration. The |
| 12 | * call starts an asynchronous operation; poll it with |
| 13 | * {@link GetControlOperation}. Provide the implementation with |
| 14 | * `Effect.provide(AWS.ControlTower.ResetEnabledControlHttp)`. |
| 15 | * ### Remediating Drift |
| 16 | * **Example:** Reset a Drifted Enabled Control |
| 17 | * ```typescript |
| 18 | * // init — bind the operation to the enabled control |
| 19 | * const resetEnabledControl = yield* AWS.ControlTower.ResetEnabledControl(guardrail); |
| 20 | * |
| 21 | * // runtime |
| 22 | * const { operationIdentifier } = yield* resetEnabledControl(); |
| 23 | * ``` |
| 24 | * |
| 25 | * @binding |
| 26 | */ |
| 27 | export interface ResetEnabledControl extends Binding.Service< |
| 28 | ResetEnabledControl, |
| 29 | "AWS.ControlTower.ResetEnabledControl", |
| 30 | ( |
| 31 | enabledControl: EnabledControl, |
| 32 | ) => Effect.Effect< |
| 33 | () => Effect.Effect< |
| 34 | controltower.ResetEnabledControlOutput, |
| 35 | controltower.ResetEnabledControlError |
| 36 | > |
| 37 | > |
| 38 | > {} |
| 39 | |
| 40 | export const ResetEnabledControl = Binding.Service<ResetEnabledControl>( |
| 41 | "AWS.ControlTower.ResetEnabledControl", |
| 42 | ); |