aws-ecs-tasks
Retrieves a list of AWS ECS tasks including Fargate tasks.
Syntax
aws-ecs-tasks [profile=PROFILE] [region=REGION] [cluster=CLUSTER] [service=SERVICE] [status=STATUS]
Options
- profile=PROFILE
- Optional. The identifier of AWS connect profile
- region=REGION
- Optional. AWS region
- cluster=CLUSTER
- Optional. Comma separated ECS cluster names or ARNs. All clusters are queried if omitted.
- service=SERVICE
- Optional. ECS service name to filter tasks
- status=STATUS
- Optional. RUNNING (default), PENDING, STOPPED, or ALL. ALL queries every status and merges the result. Note that STOPPED returns only tasks stopped within the last hour.
Output Fields
| Field | Type | Name | Description |
|---|---|---|---|
| aws_profile | String | Connect profile | The identifier of AWS connect profile |
| region | String | Region | e.g. ap-northeast-2 |
| cluster_name | String | Cluster name | e.g. prod-cluster |
| task_id | String | Task ID | The last segment of the task ARN |
| task_arn | String | Task ARN | |
| service_name | String | Service name | Derived from the task group. Null for tasks not managed by a service. |
| group | String | Task group | e.g. service:web-api, family:batch-job |
| family | String | Task definition family | e.g. web-api |
| revision | Integer | Task definition revision | e.g. 7 |
| task_definition_arn | String | Task definition ARN | |
| launch_type | String | Launch type | e.g. FARGATE, EC2, EXTERNAL |
| capacity_provider | String | Capacity provider | e.g. FARGATE, FARGATE_SPOT |
| platform_version | String | Platform version | Fargate platform version, e.g. 1.4.0 |
| platform_family | String | Platform family | e.g. Linux, Windows |
| az | String | Availability Zone | e.g. ap-northeast-2a |
| desired_status | String | Desired status | e.g. RUNNING, STOPPED |
| last_status | String | Last status | e.g. PROVISIONING, PENDING, RUNNING, STOPPED |
| health_status | String | Health status | e.g. HEALTHY, UNHEALTHY, UNKNOWN |
| connectivity | String | Connectivity | e.g. CONNECTED, DISCONNECTED |
| cpu | String | CPU units | e.g. 256, 1024 |
| memory | String | Memory | Unit: MiB. e.g. 512, 2048 |
| ephemeral_storage_gb | Integer | Ephemeral storage | Unit: GiB |
| private_ip | IP address | Private IP | Extracted from the ElasticNetworkInterface attachment of the task |
| eni_id | String | ENI ID | e.g. eni-00123456789abcdef |
| subnet_id | String | Subnet ID | |
| mac_address | String | MAC address | |
| private_dns_name | String | Private DNS name | |
| container_instance_arn | String | Container instance ARN | Null for Fargate tasks |
| enable_execute_command | Bool | ECS Exec enabled | |
| created_at | Date | Created at | |
| started_at | Date | Started at | |
| started_by | String | Started by | |
| connectivity_at | Date | Connectivity at | |
| pull_started_at | Date | Image pull started at | |
| pull_stopped_at | Date | Image pull stopped at | |
| execution_stopped_at | Date | Execution stopped at | |
| stopping_at | Date | Stopping at | |
| stopped_at | Date | Stopped at | |
| stop_code | String | Stop code | e.g. TaskFailedToStart, EssentialContainerExited, UserInitiated |
| stopped_reason | String | Stopped reason | |
| containers | List | Containers | Elements with name, container_arn, image, image_digest, runtime_id, last_status, health_status, exit_code, reason, cpu, memory, memory_reservation, and private_ip properties |
| tags | List | Tags | Elements with key and value properties |