2022-06-13 08:43:29 ERROR [codedeploy-agent(31853)]: InstanceAgent::Plugins::CodeDeployPlugin::CommandPoller: Missing credentials - please check if this instance was started with an IAM instance profile

AWS CodeDeploy 사용할 때 위와 같은 에러를 만난다면 EC2에 CodeDeploy 관련 IAM Role이 부여되기 전 CodeDeploy Agent가 EC2에서 실행되면서 IAM Role 반영이 안되었기 때문입니다.

ubuntu 환경이라면 아래 명령어를 통해서 재시작 가능합니다.

$ sudo service codedeploy-agent restart

codedeploy 로그 모니터링은 아래 경로에서 가능합니다.

$ /var/opt/aws/codedeploy-agent/codedeploy-agent.log