NEW – Using Amazon ECS Exec to access your containers on AWS Fargate and Amazon EC2 | Amazon Web Services

aws ecs execute-command \
  --cluster my-cluster \
  --task <task-id> \
  --container <container-name> \
  --interactive \
  --command "/bin/bash"