aws toolkit으로 ecs container 접속하기

x·2024년 1월 22일
0

infra

목록 보기
2/2

vscode에서 aws toolkit 설치


접속하고 싶은 service 우클릭, enable 클릭

컨테이너에서 우클릭하고 open terminal 클릭

no valid instances for this container가 뜨면 우선 컨테이너가 정상적으로 실행 중인지, 로그가 잘 뜨는지 등 확인 필요.

그리고 executecommand가 설정 됐는지 확인해야 함
aws ecs describe-tasks --cluster {클러스터명} --tasks {task id}

enalbeExecuteCommand가 false면
로그인하고 executecommand true로 수정하는 명령어를 사용해야 함

로그인

aws --region ap-northeast-2 ecr get-login-password | docker login --username AWS --password-stdin xxx.dkr.ecr.us-west-2.amazonaws.com
aws ecs update-service --cluster {ecs 클러스터명} --service {ecs 서비스명} --region ap-northeast-2 --enable-execute-command --force-new-deployment

재배포되면 다시 컨테이너에서 우클릭하고 open terminal 클릭

0개의 댓글