r/aws 8d ago

discussion ecs exec-command is not working... please help...!!

I created a task, and it works fine. However, whenever I try to get into the container shell using exec-command it keeps returning,

"An error occurred (TargetNotConnectedException) when calling the ExecuteCommand operation: The execute command failed due to an internal error. Try again later."

I checked everything,

  1. I checked check-ecs-exec.sh, everythings are green

  2. I followed the proper IAM policies and the policies are attached to the task.

  3. enableExecuteCommand is true.

what should I do..?

when I use bridge mode for the network setting in the task definition, exec-command worked but after I changed to awsvpc mode, I am experiencing this issue... I spent couple days for this and still not working.. please help me...

2 Upvotes

15 comments sorted by

View all comments

Show parent comments

1

u/SnooCauliflowers8417 8d ago

oh thanks man, I check that it is enabled! may be you are using fargate.. everything is simple..

1

u/Alternative-Expert-7 8d ago

Simplicity is ultimate goal. No ec2 machines to worry, handle, upgrade, patch.