Skip to content

GetConsoleOutput

Source: src/AWS/EC2/GetConsoleOutput.ts

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

Fetches the instance’s serial console output (base64-encoded) — e.g. a diagnostics Lambda that captures boot logs when a host fails its health checks. Pass Latest: true for the most recent output on supported instance types. Provide the implementation with Effect.provide(AWS.EC2.GetConsoleOutputHttp).

// init — bind the operation to the instance
const getConsoleOutput = yield* AWS.EC2.GetConsoleOutput(instance);
// runtime — fetch the (base64-encoded) boot log
const result = yield* getConsoleOutput({ Latest: true });
const log = Buffer.from(result.Output ?? "", "base64").toString("utf8");