Amazon ECS ExecModule
Overview
AwsEcsModule reads service inventory and deployment details from Amazon Elastic Container Service (Amazon ECS). Use it to reconcile an inventory against a specific cluster, check how many tasks are running during a release, or add the deployment state and task definition to an incident record.
The connector reads the ECS control plane. Task counts and rollout state can help a workflow decide what to investigate. Use application probes and load balancer metrics to assess what users are experiencing.
Usage
- Create an Amazon ECS connection in the Integration Account Console. Verify the connection and confirm its status is
READY. - In Workflow Studio, add Amazon ECS to a task and select the connection under General > Connection.
- Set the region and exact cluster. Run
list_servicesto discover service ARNs ordescribe_serviceswith up to ten known service identifiers. - Check
statusbefore using the output. Continue a list whilehasMoreis true. When describing services, inspectfailureseven whenstatusissuccess.
Inputs
| Input | Type | Required | Default | Purpose |
|---|---|---|---|---|
operation | string | No | list_services | Select list_services or describe_services. |
region | string | Yes | — | Commercial AWS or AWS GovCloud region hosting the cluster. |
cluster | string | Yes | — | Exact cluster name or full ECS cluster ARN in the selected region and partition. Specify a cluster even when its name is default. |
pageSize | integer | No | 100 | Request 1–100 service ARNs per list page. Use for list_services. |
nextToken | string | No | — | Opaque continuation token from the preceding list_services result. |
services | string array | For describe | — | Provide 1–10 distinct service names or full service ARNs in the selected region and partition. Use for describe_services. |
Outputs
| Output | Meaning |
|---|---|
status | success or error for the request. A successful describe request can still contain individual service failures. |
operation / region / cluster | Requested scope when available. |
serviceArns | Service ARNs from one list page. |
hasMore / nextToken | Whether AWS returned another list page and the token to continue. |
services | Described service rows with available serviceName, serviceArn, status, desiredCount, runningCount, pendingCount, and deployments. |
failures | Per-service describe failures with an ARN and reason when safe to return. Free-form AWS failure details are omitted. |
requestId | AWS request reference when available. |
error | Redacted information for a failed request, including retryability. |
A deployment row can include id, status, rolloutState, taskDefinition, desiredCount, pendingCount, runningCount, and failedTasks. Treat missing deployment fields as unavailable. For example, AWS supplies rolloutState for supported ECS rolling deployments. AWS deployment fields
IntegrationAccount Requirements
Use a verified Amazon ECS connection with account name AWS and status READY. Put the access key ID and secret access key in the protected AWS Access Key ID and AWS Secret Access Key fields. The module uses that key pair to sign requests with AWS Signature Version 4. This connection uses an access key pair without a session token.
Grant ecs:ListServices for discovery and ecs:DescribeServices for service details as needed. Scope ecs:ListServices with the ecs:cluster condition and restrict ecs:DescribeServices to the service ARNs the workflow needs. Amazon ECS IAM actions and resource types
Configuration
The module derives the ECS HTTPS endpoint from the selected AWS region. Keep the credentials in the Integration Account. Run separate invocations for each account, region, and cluster.
Operations
list_servicesreads one page of service ARNs for an explicit cluster. Use the ARNs to reconcile an inventory or feed a describe step in batches of up to ten. AWS ListServices APIdescribe_servicesreads service status, task counts, and selected deployment fields for known services. A service-level failure leaves other returned service rows available for processing. AWS DescribeServices API
Errors and Failure Modes
VALIDATION_ERRORindicates an unsupported operation, invalid region or identifier, or an input that belongs to the other operation. Verify that the service identifiers belong to the selected cluster.INTEGRATION_ACCOUNT_ERRORcalls for checking the connection's verification, readiness, and protected key fields.- For an AWS authorization or lookup error, check the IAM permissions, region, and cluster scope. Use the AWS request ID for investigation when available.
- If
failurescontains a service, reconcile that identifier against the cluster inventory before deciding whether to retry. A missing service has no verified deployment state. - Retry transient AWS or network errors with backoff when the error is marked retryable. Keep concurrency bounded across scheduled scans.
Example
A release workflow can describe the checkout service and record the current task counts and rollout state alongside the release record.
{
"operation": "describe_services",
"region": "us-west-2",
"cluster": "commerce-prod",
"services": ["checkout"]
}
A result can contain the following service and deployment snapshot.
{
"status": "success",
"operation": "describe_services",
"region": "us-west-2",
"cluster": "commerce-prod",
"services": [
{
"serviceName": "checkout",
"serviceArn": "arn:aws:ecs:us-west-2:111122223333:service/commerce-prod/checkout",
"status": "ACTIVE",
"desiredCount": 4,
"runningCount": 3,
"pendingCount": 1,
"deployments": [
{
"status": "PRIMARY",
"rolloutState": "IN_PROGRESS",
"taskDefinition": "arn:aws:ecs:us-west-2:111122223333:task-definition/checkout:42"
}
]
}
],
"failures": []
}
Use serviceArn to correlate records. In this example, the primary rollout is still in progress. A workflow could wait for another sample within a bounded window and route a persistent mismatch to the service owner.
Notes
- Keep the connection, region, cluster, and page size fixed when following a list token. AWS may return fewer ARNs than requested. Follow
hasMoreto determine whether to continue. - ECS API throttling applies per account and region. Pace polling and batches across workflows that share the same connection. Amazon ECS API throttling
- Both operations are read-only and can be repeated safely. Results can change as services and deployments change. Service creation, scaling, updates, and deletion are outside the connector's scope.