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
gefragt vor 2 Jahren837 Aufrufe
1 Antwort
1
Akzeptierte Antwort

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
beantwortet vor 2 Jahren
profile pictureAWS
EXPERTE
Toni_S
überprüft vor 2 Jahren

Du bist nicht angemeldet. Anmelden um eine Antwort zu veröffentlichen.

Eine gute Antwort beantwortet die Frage klar, gibt konstruktives Feedback und fördert die berufliche Weiterentwicklung des Fragenstellers.

Richtlinien für die Beantwortung von Fragen