Skip to content

DescribeAutoScalingGroup

Source: src/AWS/AutoScaling/DescribeAutoScalingGroup.ts

Runtime binding for the DescribeAutoScalingGroups operation scoped to one group (IAM action autoscaling:DescribeAutoScalingGroups; EC2 Auto Scaling Describe* actions do not support resource-level permissions, so the grant is on *).

Returns the bound group’s live description — capacity, instances and their lifecycle states, suspended processes — or undefined if the group no longer exists. Provide the implementation with Effect.provide(AWS.AutoScaling.DescribeAutoScalingGroupHttp).

// init — bind the operation to the group
const describeGroup = yield* AWS.AutoScaling.DescribeAutoScalingGroup(group);
// runtime — read the group's live state
const live = yield* describeGroup();
const inService = (live?.Instances ?? []).filter(
(i) => i.LifecycleState === "InService",
);