# 透過AWS ECS Command進入ECS容器內部 **可以透過下面的command, 看到Task有沒有enable-exeucte-command** aws ecs describe-tasks --cluster uat-live --tasks arn:aws:ecs:ap-northeast-1:283732428191:task/uat-live/63a4b4309f1e473fbbe7b8d11a5a7e4a  **下面的指令,等於docker exec -it xxxx,可以進入容器內部** aws ecs execute-command --cluster uat-live --task arn:aws:ecs:ap-northeast-1:283732428191:task/uat-live/63a4b4309f1e473fbbe7b8d11a5a7e4a --container uat-live-bo-api --interactive --command "/bin/bash"  進container裡了  **注意事項** 1. 任務角色和執行角色要給permission...我給到ecsfullaccess才連的進去 2. 要安裝Session Manager plugin 3. update service時要把enabled-execute-command打開  我透過 aws cli都不work…後來是透過wofy的python透過sdk更新才行 4. ECS Task Id 可以參考下圖  細節可以參考這一篇 https://www.ernestchiang.com/zh/posts/2021/using-amazon-ecs-exec/ 不過他說的iam,我assign完還是不work
×
Sign in
Email
Password
Forgot password
or
By clicking below, you agree to our
terms of service
.
Sign in via Facebook
Sign in via Twitter
Sign in via GitHub
Sign in via Dropbox
Sign in with Wallet
Wallet (
)
Connect another wallet
New to HackMD?
Sign up