Amazon EC2 ExecModule
Overview
AwsEc2Module reads instance inventory and infrastructure health from Amazon Elastic Compute Cloud (EC2). Use it to record which instances a workflow manages, add placement and lifecycle context to an incident, or flag instances with impaired AWS status checks for review.
The inventory operation reports the instance's lifecycle state. The health operation returns AWS status checks for the instance, the underlying system, and attached EBS volumes when AWS reports them. Join the two results by instanceId within the same account and region.
Usage
- Create an Amazon EC2 connection in the Integration Account Console. Verify it and confirm its status is
READY. - In Workflow Studio, add Amazon EC2 to a task. Select the connection under General > Connection.
- Enter the AWS region and choose an operation. Supply a nonempty array of instance IDs to check known instances or omit the field to scan the region.
- Check
statusbefore using the result. For regional scans, continue whilehasMoreis true by passingnextTokento the next invocation.
Inputs
| Input | Type | Required | Default | Purpose |
|---|---|---|---|---|
operation | string | No | describe_instances | Choose describe_instances or describe_instance_status. |
region | string | Yes | — | Commercial AWS or AWS GovCloud region. |
instanceIds | string array | No | — | Between 1 and 100 unique EC2 instance IDs when supplied. Omit this field for a regional scan. |
pageSize | integer | No | 100 | Request 5–1,000 results per regional page. Leave the default when sending explicit IDs. |
nextToken | string | No | — | Opaque continuation token from the previous regional page. Omit when sending explicit IDs. |
includeAllInstances | boolean | No | false | For describe_instance_status, include instances beyond the running state. |
Outputs
| Output | Meaning |
|---|---|
status | success or error. |
operation / region | Recognized operation and AWS region when available. |
instances | Inventory rows with instanceId and the available instanceType, imageId, state, availabilityZone, vpcId, and subnetId. |
instanceStatuses | Health rows with instanceId and the available state, availabilityZone, systemStatus, instanceStatus, and attachedEbsStatus. |
hasMore / nextToken | Whether AWS reports another page and the token for continuing. |
requestId | AWS request reference when available. |
error | Redacted error information and retryability. |
The module returns the row collection for the selected operation. Treat a missing health field as unavailable and use application-level monitoring for service readiness.
IntegrationAccount Requirements
Use a verified Amazon EC2 connection with account name AWS and status READY. Store the key pair in the protected AWS Access Key ID and AWS Secret Access Key fields. The module signs requests with AWS Signature Version 4 using that key pair. This connection uses an access key pair without a session token.
Grant ec2:DescribeInstances for inventory and ec2:DescribeInstanceStatus for health, according to the operations the workflow needs. Use the Amazon EC2 service authorization reference to review the permissions and supported policy conditions.
Configuration
Choose the AWS region containing the instances. The module uses the standard regional EC2 HTTPS endpoint. Run separate scans for each approved connection and region. Keep the credentials in the Integration Account fields.
Operations
describe_instancesreturns normalized instance inventory. The module flattens EC2 reservations into one list of instance rows. AWS DescribeInstances APIdescribe_instance_statusreturns AWS health checks. By default AWS returns status for running instances. SetincludeAllInstancesfor a broader view. AWS DescribeInstanceStatus API
Errors and Failure Modes
- For a validation error, check the operation, region, ID formats, and pagination inputs. Use either explicit IDs or regional pagination.
- For a connection error, verify the account's provider, readiness, and protected credential fields.
- For a provider authorization or lookup error, check the IAM policy, AWS account, and region. Use the AWS request ID for investigation when present.
- For a retryable failure such as throttling or a transient network interruption, back off before retrying the workflow.
Example
An incident workflow can look up one instance reported by an alarm and use its health checks to guide triage.
{
"operation": "describe_instance_status",
"region": "us-west-2",
"instanceIds": ["i-0123456789abcdef0"]
}
A successful response can contain a row like this.
{
"status": "success",
"operation": "describe_instance_status",
"region": "us-west-2",
"instanceStatuses": [
{
"instanceId": "i-0123456789abcdef0",
"state": "running",
"availabilityZone": "us-west-2a",
"systemStatus": "ok",
"instanceStatus": "impaired",
"attachedEbsStatus": "ok"
}
],
"hasMore": false
}
Use the result to route the incident for investigation. Compare it with application telemetry and the corresponding inventory row.
Notes
- A regional page can contain fewer results than requested. Follow
hasMoreeven when the current page is empty, and keep the operation, region, connection, and pagination settings stable while continuing. - EC2 applies API request quotas and changes can take time to appear in describe results. Bound fan-out across accounts and regions. AWS EC2 API throttling
- Both operations are read-only and safe to repeat. Instance launch, reboot, stop, termination, and configuration changes are outside the connector's scope.