| 1 | import type * as ec2 from "@distilled.cloud/aws/ec2"; |
| 2 | import type * as Effect from "effect/Effect"; |
| 3 | import * as Binding from "../../Binding.ts"; |
| 4 | import type { Instance } from "./Instance.ts"; |
| 5 | |
| 6 | /** |
| 7 | * `RebootInstances` request with `InstanceIds` injected from the bound |
| 8 | * {@link Instance}. |
| 9 | */ |
| 10 | export interface RebootInstanceRequest extends Omit< |
| 11 | ec2.RebootInstancesRequest, |
| 12 | "InstanceId" | "InstanceIds" |
| 13 | > {} |
| 14 | |
| 15 | /** |
| 16 | * Runtime binding for the `RebootInstances` operation scoped to the bound |
| 17 | * {@link Instance} (IAM action `ec2:RebootInstances` on the instance ARN). |
| 18 | * |
| 19 | * Requests an asynchronous reboot of the instance — e.g. a remediation Lambda |
| 20 | * that bounces a wedged host after a failed health check. Provide the |
| 21 | * implementation with `Effect.provide(AWS.EC2.RebootInstanceHttp)`. |
| 22 | * ### Instance Lifecycle Control |
| 23 | * **Example:** Reboot the bound instance |
| 24 | * ```typescript |
| 25 | * // init — bind the operation to the instance |
| 26 | * const rebootInstance = yield* AWS.EC2.RebootInstance(instance); |
| 27 | * |
| 28 | * // runtime — request the reboot (asynchronous) |
| 29 | * yield* rebootInstance(); |
| 30 | * ``` |
| 31 | * |
| 32 | * @binding |
| 33 | */ |
| 34 | export interface RebootInstance extends Binding.Service< |
| 35 | RebootInstance, |
| 36 | "AWS.EC2.RebootInstance", |
| 37 | ( |
| 38 | instance: Instance, |
| 39 | ) => Effect.Effect< |
| 40 | ( |
| 41 | request?: RebootInstanceRequest, |
| 42 | ) => Effect.Effect<ec2.RebootInstancesResponse, ec2.RebootInstancesError> |
| 43 | > |
| 44 | > {} |
| 45 | |
| 46 | export const RebootInstance = Binding.Service<RebootInstance>( |
| 47 | "AWS.EC2.RebootInstance", |
| 48 | ); |