Skip to content

DescribeInstanceStatus

Source: src/AWS/EC2/DescribeInstanceStatus.ts

Runtime binding for the DescribeInstanceStatus operation scoped to the bound Instance (IAM action ec2:DescribeInstanceStatus; Describe* actions do not support resource-level permissions, so the grant is on *).

Reads the instance’s system/instance status checks and scheduled events — e.g. a Lambda that alerts on failed reachability checks. Pass IncludeAllInstances: true to also see the status while the instance is stopped. Provide the implementation with Effect.provide(AWS.EC2.DescribeInstanceStatusHttp).

// init — bind the operation to the instance
const describeStatus = yield* AWS.EC2.DescribeInstanceStatus(instance);
// runtime — read status checks (even while stopped)
const result = yield* describeStatus({ IncludeAllInstances: true });
console.log(result.InstanceStatuses?.[0]?.InstanceStatus?.Status);