wallix / awless

A Mighty CLI for AWS
http://awless.io/
Apache License 2.0
4.97k stars 263 forks source link

Making sense of ECS container tasks #290

Open alkalinecoffee opened 3 years ago

alkalinecoffee commented 3 years ago

Hi 👋

I'm evaluating awless and have been looking to get some ECS task information out of it, namely, a simple list of our running ECS Fargate tasks, but have not been able to figure out how to get the info I'm looking for.

The AWS CLI would produce this output:

$ aws ecs list-tasks --cluster my-app-prod
{
    "taskArns": [
        "arn:aws:ecs:us-east-1:xxx:task/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
        "arn:aws:ecs:us-east-1:xxx:task/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
        "arn:aws:ecs:us-east-1:xxx:task/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
        "arn:aws:ecs:us-east-1:xxx:task/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
    ]
}

I've tried all of the ECS-related awless commands, but none produce output similar to this.

awless ls containers produces a list of all the containers. awless ls containerclusters produces a list of clusters, and a count of running tasks. Close, but I still can't get the ARNs of those tasks. awless ls containerinstances returns nothing in my case (we're running in Fargate--no EC2 instances). awless ls containertasks was the most confusing to me because of its name and output. It seems to return multiple task definitions and the containers within them, and also whether that task definition is running. No discernible info about tasks that I can tell.

Is there a command I'm missing that would produce something similar to aws ecs list-tasks? Thanks!