I have the following cli command
aws ecs list-services --cluster ecs-cluster-1
Giving this JSON
{
"serviceArns": [
"arn:aws:ecs:us-east-1:XXXXXXXXXXXXX:service/ecs-cluster-1/app4",
"arn:aws:ecs:us-east-1:XXXXXXXXXXXXX:service/ecs-cluster-1/app3",
"arn:aws:ecs:us-east-1:XXXXXXXXXXXXX:service/ecs-cluster-1/app1",
"arn:aws:ecs:us-east-1:XXXXXXXXXXXXX:service/ecs-cluster-1/app4"
]
}
How do I get app1
ARN back by matching name of the app (app1
) using --query
option?
Expected Output
arn:aws:ecs:us-east-1:XXXXXXXXXXXXX:service/ecs-cluster-1/app1
Please note that this JSON array is not ordered.