Skip to content

DescribeInstance

Source: src/AWS/EC2/DescribeInstance.ts

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

Returns the bound instance’s live description — state, addresses, block device mappings — e.g. a Lambda that reports whether a dev box is running. Provide the implementation with Effect.provide(AWS.EC2.DescribeInstanceHttp).

// init — bind the operation to the instance
const describeInstance = yield* AWS.EC2.DescribeInstance(instance);
// runtime — read the live description
const live = yield* describeInstance();
console.log(live?.State?.Name, live?.PrivateIpAddress);