Amazon EC2 Auto Scaling ExecModule
Overview
AwsAutoScalingModule reads Auto Scaling group capacity settings and the health and lifecycle states of member EC2 instances. Use group snapshots to compare desired capacity with an operating target, or enrich an EC2 incident with the group, lifecycle state, and scale-in protection of the affected instance.
The two operations provide different views. Group results describe configured capacity bounds and desired capacity. Instance results show how Auto Scaling classifies the instances it returns. Check application and load balancer telemetry separately when deciding whether a fleet can serve traffic.
Usage
- Create an Amazon EC2 Auto Scaling connection in the Integration Account Console. Verify it and confirm that the connection status is
READY. - Add Amazon EC2 Auto Scaling to a Workflow Studio task. Select the connection under General > Connection and specify the region.
- Choose a group or instance operation. Supply the corresponding selector for targeted lookups or omit it for regional inventory.
- Check
statusbefore processing results. IfhasMoreis true, passnextTokento the next invocation with the same parameters.
Inputs
| Input | Type | Required | Default | Purpose |
|---|---|---|---|---|
operation | string | No | describe_auto_scaling_groups | Select describe_auto_scaling_groups or describe_auto_scaling_instances. |
region | string | Yes | — | Commercial AWS or AWS GovCloud region to query. |
pageSize | integer | No | 50 | Request 1–100 group records or 1–50 instance records per page. |
nextToken | string | No | — | Opaque token of up to 8,192 characters returned by the same operation, region, selector, and page size. |
groupNames | string array | No | — | Group operation only. If supplied, give 1–50 distinct exact names of up to 255 characters, with no blank names or control characters. Omit to inventory all groups in the region. |
instanceIds | string array | No | — | Instance operation only. If supplied, give 1–50 distinct EC2 IDs with i- followed by 8 or 17 lowercase hexadecimal characters. Omit to inventory Auto Scaling instances in the region. |
Outputs
| Output | Meaning |
|---|---|
status | success or error for the request. |
operation, region | Operation and scope when available. |
groups | One page of group records with groupName, minSize, maxSize, desiredCapacity, and availabilityZones. When available, records include groupArn, desiredCapacityType, and healthCheckType. |
instances | One page of instance records with instanceId and groupName. When available, records include instanceType, availabilityZone, lifecycleState, healthStatus, protectedFromScaleIn (boolean), and weightedCapacity (numeric text from AWS). |
hasMore, nextToken | Whether AWS returned another page, and its continuation token when available. |
requestId | AWS request reference when available. |
error | Redacted failure with code, message, retryable, and httpStatus when available. |
Group records omit tags, raw launch configuration, and nested instances. Desired capacity can be expressed in capacity units instead of instance count. Check desiredCapacityType and any reported instance weights before comparing it with a count of instances.
IntegrationAccount Requirements
Use a verified connection with account name AWS and status READY. Store the access key ID and secret access key in the protected AWS Access Key ID and AWS Secret Access Key fields. The module signs requests with AWS Signature Version 4 using this key pair. The connection supports basic AWS access keys. Session-token and assumed-role authentication are outside this module’s scope.
Grant autoscaling:DescribeAutoScalingGroups for group reads and autoscaling:DescribeAutoScalingInstances for instance reads. Use only the actions the workflow needs. Use Resource: "*" for these two actions. Selectors narrow the request while the IAM grant applies across resources. AWS service authorization reference
Configuration
Select the AWS account through the Integration Account and set the region in the task. The module derives the regional HTTPS endpoint from this input. Run separate invocations for each account and region. Keep credential values out of task parameters and workflow logs.
Operations
describe_auto_scaling_groupsreads one page of group settings, optionally restricted to named groups. Use it to inventory desired capacity, bounds, and Availability Zone coverage. AWS DescribeAutoScalingGroups APIdescribe_auto_scaling_instancesreads one page of member instances, optionally restricted to explicit IDs. Use it to find an instance's group or enrich a workflow with its Auto Scaling lifecycle and health. AWS can omit an unknown instance ID from a successful response. Compare requested IDs with the returned set after reading all pages. AWS DescribeAutoScalingInstances API
Errors and Failure Modes
- For
VALIDATION_ERROR, check the region, selector, and page size for the chosen operation. - For
INTEGRATION_ACCOUNT_ERROR, verify it is ready and check both protected key fields. - If AWS denies access, check the selected account, region, and IAM action. Use the AWS request ID for investigation when available.
- If a token becomes invalid, restart the read from the first page with the original parameters.
- The module retries eligible transient errors within a bounded window. If it still returns a retryable error, use backoff and limit concurrency across workflows that share the connection.