StopInstance
Source:
src/AWS/EC2/StopInstance.ts
Runtime binding for the StopInstances operation scoped to the bound
Instance (IAM action ec2:StopInstances on the instance ARN).
Stops the running instance — the other half of the scheduled
start/stop-Lambda pattern that powers dev fleets off overnight. Pass
Hibernate: true for hibernation-enabled instances. Provide the
implementation with Effect.provide(AWS.EC2.StopInstanceHttp).
Instance Lifecycle Control
Section titled “Instance Lifecycle Control”// init — bind the operation to the instanceconst stopInstance = yield* AWS.EC2.StopInstance(instance);
// runtime — power the instance offconst result = yield* stopInstance();console.log(result.StoppingInstances?.[0]?.CurrentState?.Name);