mebdock95
(Mohamad El Bohsaly)
March 13, 2023, 7:37pm
1
I am performing
aws ecs execute-command \
--cluster <CLUSTER> \
--task <TASK ARN> \
--container <CONTAINER NAME>\
--interactive \
--command "/bin/sh" \
But I still get an exception whether from AWS CLI terminal or CloudShell. Why so? I just want to have remote access via shell to troubleshoot some stuff rather than relaunching a CI/CD pipeline.
rimelek
(Ákos Takács)
March 13, 2023, 8:29pm
2
mebdock95:
I still get an exception
Unless you can share the exception there is not much we can do to help
I also fixed your shared code. Please, use code blocks or shared codes will be changed by the forum and it will be unreadable.
The Docker forum is using Discourse , which supports several ways to format your posts:
Markdown; see commonmark.org/help for an interactive tutorial
BBCode
A small selection of HTML
Any combination of the above
Blank lines for formatting and readability
Quite often you’ll need an empty line above specific formatting to make it work.
You also need to type blank lines to create proper paragraphs; just pressing Return once and then typing a new block of text right below a previous block only…
Does the question has anything to do with Docker Hub? Did you just wanted to ask the question in a CI/CD category not related to Docker Hub?
meyay
(Metin Y.)
March 13, 2023, 10:24pm
3
The original post misses to mention 3 relevant details:
whether the session manager plugin for the aws cli is installed
whether the task execution (iam) role allows the required actions in the ssmmessage:
namespace
whether the task definition is extended by the required configuration elements to actually allow to exec into the task
By default, a service does not allow to exec into the task. It needs to be configured specifically.
It’s well documented:
At the bottom of the page, it provides a link to GitHub - aws-containers/amazon-ecs-exec-checker: 🚀 Pre-flight checks for ECS Exec , which looks usefull when troubleshooting the root cause of ecs exec problems.