Skip to main content

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​

  1. Create an Amazon EC2 connection in the Integration Account Console. Verify it and confirm its status is READY.
  2. In Workflow Studio, add Amazon EC2 to a task. Select the connection under General > Connection.
  3. 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.
  4. Check status before using the result. For regional scans, continue while hasMore is true by passing nextToken to the next invocation.

Inputs​

InputTypeRequiredDefaultPurpose
operationstringNodescribe_instancesChoose describe_instances or describe_instance_status.
regionstringYes—Commercial AWS or AWS GovCloud region.
instanceIdsstring arrayNo—Between 1 and 100 unique EC2 instance IDs when supplied. Omit this field for a regional scan.
pageSizeintegerNo100Request 5–1,000 results per regional page. Leave the default when sending explicit IDs.
nextTokenstringNo—Opaque continuation token from the previous regional page. Omit when sending explicit IDs.
includeAllInstancesbooleanNofalseFor describe_instance_status, include instances beyond the running state.

Outputs​

OutputMeaning
statussuccess or error.
operation / regionRecognized operation and AWS region when available.
instancesInventory rows with instanceId and the available instanceType, imageId, state, availabilityZone, vpcId, and subnetId.
instanceStatusesHealth rows with instanceId and the available state, availabilityZone, systemStatus, instanceStatus, and attachedEbsStatus.
hasMore / nextTokenWhether AWS reports another page and the token for continuing.
requestIdAWS request reference when available.
errorRedacted 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_instances returns normalized instance inventory. The module flattens EC2 reservations into one list of instance rows. AWS DescribeInstances API
  • describe_instance_status returns AWS health checks. By default AWS returns status for running instances. Set includeAllInstances for 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 hasMore even 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.