3월, 2024의 게시물 표시

[AWS] CodeDeploy 오류: The overall deployment failed because too many individual instances failed deployment, too few healthy instances are available for deployment, or some instances in your deployment group are experiencing problems.

이미지
개발환경은 아래와 같다. - Github Actions - AWS S3 - AWS CodeDeploy  - AWS EC2(ubuntu server v22.04) 위 환경에서 배포 자동화 설정 중 CodeDeploy에서 발생했던 오류를 해결했던 정리하려한다. AWS CodeDeploy Console 오류 화면 오류 메세지: The overall deployment failed because too many individual instances failed deployment, too few healthy instances are available for deployment, or some instances in your deployment group are experiencing problems. CodeDeploy 콘솔에서 배포 오류 이벤트 내역을 확인해도 되지만 보다 정확한 문제를 확인하기위해서는 CodeDeploy가 실행되는 ec2 인스턴스에 ssh에 접속해 CodeDeploy에 대한 로그를 확인해보는것이 좋다. * Ubuntu EC2 인스턴스에 CodeDeploy agent가 설치되어 있어야 한다. Install the CodeDeploy agent for Ubuntu Server 아래 명령어를 통해 codedeploy agent log가 저장되어있는 위치로 이동한다. $ cd /var/log/aws/codedeploy-agent 아래 명령어를 통해 로그 내역을 확인할 수 있다. $   cat codedeploy-agent.log 나의 경우 로그에 아래와 같이 에러 로그가 찍혀있었다. ERROR [codedeploy-agent(2423)]: InstanceAgent::Plugins::CodeDeployPlugin::CommandPoller: Missing credentials - please check if this instance was started with an IAM instance profile INFO  [codedeploy-agent(2423