Can I access fargate's container?

0

In local, I was able to connect to the container through the docker exec command.

However, fargate is a serverless service, so I wonder if it can connect to the container.

joker
질문됨 2년 전837회 조회
1개 답변
1
수락된 답변

You cannot access the host in Fargate and run docker exec from there. However, you can enable ECS Command Execution in your task/service definition and then use the command aws ecs execute command which is going to have the same effect.

I can't recommend more to configure your cluster logging settings to log these exec commands so that you can audit when your users ran commands and see what these are (and their outputs).

Activating it is rather simple, but if you want something that will take care of creating the task definitions and possibly the cluster for you, look at x-cluster and x-ecs.EnableExecuteCommand which will create the CFN templates for you.

If you are using an existing cluster and these settings are set for command logging, compose-x will automatically detect that and configure IAM permissions accordingly.

Hope this helps,

profile picture
답변함 2년 전
profile pictureAWS
전문가
Toni_S
검토됨 2년 전

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠