aws ecs describe-tasks \
--cluster CLUSTER_NAME \
--task TASK_ID --query 'tasks[*].enableExecuteCommand' | jqaws ecs update-service \
--cluster CLUSTER_NAME \
--service SERVICE_NAME \
--enable-execute-commandaws ecs update-service \
--cluster CLUSTER_NAME \
--service SERVICE_NAME \
--force-new-deploymentaws ecs execute-command \
--cluster CLUSTER_NAME \
--task TASK_ID \
--container CONTAINER_NAME \
--interactive \
--command "/bin/sh"OBS.: THE IAM TASK ROLE, ADD THE PERMISSIONS BELLOW:
"ssmmessages:*",
"ssm:StartSession",
"ssm:SendCommand"