#!/bin/bash
$myecs_securitytoken=$(aws ecr get-authorization-token --region
--output text --query authorizationData[].authorizationToken)
$myecs_securitytoken
$aws ecs list-tasks --region --cluster
--family --query taskArns| cut -c46-81 > taskidinfo.out
filename="taskidinfo.out"
IFS=$'\n'
for line in $(cat $filename)
do
$aws ecs stop-task --region --cluster ""
--task $line --reason "stopping the task"
done
Note:
Collect all the IDs of the task in the file taskidinfo.out,
read each line from the file and stop the task using the taskID
No comments:
Post a Comment