Skip to content

StartInstance

Source: src/AWS/EC2/StartInstance.ts

Runtime binding for the StartInstances operation scoped to the bound Instance (IAM action ec2:StartInstances on the instance ARN).

Starts the stopped instance — the classic scheduled Lambda that powers dev boxes on in the morning. Starting an already-running instance succeeds without effect. Provide the implementation with Effect.provide(AWS.EC2.StartInstanceHttp).

// init — bind the operation to the instance
const startInstance = yield* AWS.EC2.StartInstance(instance);
// runtime — power the instance on
const result = yield* startInstance();
console.log(result.StartingInstances?.[0]?.CurrentState?.Name);