Skip to main content

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​

  1. Create an Amazon EC2 Auto Scaling connection in the Integration Account Console. Verify it and confirm that the connection status is READY.
  2. Add Amazon EC2 Auto Scaling to a Workflow Studio task. Select the connection under General > Connection and specify the region.
  3. Choose a group or instance operation. Supply the corresponding selector for targeted lookups or omit it for regional inventory.
  4. Check status before processing results. If hasMore is true, pass nextToken to the next invocation with the same parameters.

Inputs​

InputTypeRequiredDefaultPurpose
operationstringNodescribe_auto_scaling_groupsSelect describe_auto_scaling_groups or describe_auto_scaling_instances.
regionstringYes—Commercial AWS or AWS GovCloud region to query.
pageSizeintegerNo50Request 1–100 group records or 1–50 instance records per page.
nextTokenstringNo—Opaque token of up to 8,192 characters returned by the same operation, region, selector, and page size.
groupNamesstring arrayNo—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.
instanceIdsstring arrayNo—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​

OutputMeaning
statussuccess or error for the request.
operation, regionOperation and scope when available.
groupsOne page of group records with groupName, minSize, maxSize, desiredCapacity, and availabilityZones. When available, records include groupArn, desiredCapacityType, and healthCheckType.
instancesOne 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, nextTokenWhether AWS returned another page, and its continuation token when available.
requestIdAWS request reference when available.
errorRedacted 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_groups reads one page of group settings, optionally restricted to named groups. Use it to inventory desired capacity, bounds, and Availability Zone coverage. AWS DescribeAutoScalingGroups API
  • describe_auto_scaling_instances reads 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.

Example​

An incident workflow can attach Auto Scaling context to a known checkout instance before an operator investigates failed health checks.

{
"operation": "describe_auto_scaling_instances",
"region": "us-west-2",
"instanceIds": ["i-0123456789abcdef0"]
}

One possible result follows.

{
"status": "success",
"operation": "describe_auto_scaling_instances",
"region": "us-west-2",
"instances": [
{
"instanceId": "i-0123456789abcdef0",
"groupName": "checkout-prod",
"availabilityZone": "us-west-2a",
"lifecycleState": "InService",
"healthStatus": "UNHEALTHY",
"protectedFromScaleIn": false
}
],
"hasMore": false
}

The instance belongs to checkout-prod and Auto Scaling reports it as unhealthy. An incident workflow can add those details to the incident and query the group separately for its capacity settings.

Notes​

  • The connector reads one page per invocation. Keep the account, operation, region, selector, and page size fixed while following a continuation token. Inventory can change between pages.
  • Use bounded polling. AWS can throttle requests for groups with many instances even though the connector omits nested instances from its output. Amazon EC2 Auto Scaling API guidance
  • Both operations are read-only and can be repeated safely. Scaling, instance replacement, and dedicated warm pool inventory are outside this connector's scope.