To Nha Notes | Sept. 13, 2024, 9:29 a.m.
Amazon ECS Exec is a powerful feature that allows you to run commands and get a shell inside your running ECS containers. This makes it easier to debug issues, collect diagnostic information, and interact with your containerized applications.
To run a command in your container, use the aws ecs execute-command CLI command:
aws ecs execute-command \
--cluster <cluster-name> \
--task <task-arn> \
--container <container-name> \
--interactive \
--command "<command>"
Replace the placeholders with your specific cluster name, task ARN, container name, and the command you want to run.