개발자의 서재

AWS - Elastic Beanstalk 생성 시 오류 "The instance profile aws-elasticbeanstalk-ec2-role associated with the enviroment dose not exist." 본문

AWS

AWS - Elastic Beanstalk 생성 시 오류 "The instance profile aws-elasticbeanstalk-ec2-role associated with the enviroment dose not exist."

ironmask431 2023. 12. 19. 23:04

 

aws elasticbeanstalk 서비스를 신규 생성해보는데 계속해서 동일한 에러가 발생하였다. 

 

구글링 결과 스택오버플로우에서 아래와 같은 내용을 확인하였다. 

https://stackoverflow.com/questions/30790666/error-with-not-existing-instance-profile-while-trying-to-get-a-django-project-ru

 

Error with not existing instance profile while trying to get a django project running on AWS Beanstalk

I`m trying to deploy a django project to AWS Beanstalk following this tutorial. I executed eb create and after a while I get the error The instance profile aws-elasticbeanstalk-ec2-role associa...

stackoverflow.com

 

 

"aws-elasticbeanstalk-ec2-role" 

이라는 보안정책이 존재하지않아서 발생하는것으로 추정 

 

aws-IAM 으로 이동하여 "역할" 메뉴에 들어가보았다. 

 

 

현재는 "aws-elasticbeanstalk-ec2-role" 역할이 추가 되어있지만 처음 들어왔을 때는 없었다. 

그래서 추가로 생성해주었다. 

 

Role name: aws-elasticbeanstalk-ec2-role

 

 

추가한 권한은 아래 세가지이다. 

  • AWSElasticBeanstalkWebTier
  • AWSElasticBeanstalkWorkerTier
  • AWSElasticBeanstalkMulticontainerDocker

 

추가 완료 한 모습이다. 

 

 

역할 추가 후 다시 Elastic Beanstalk 생성을 하자  생성 성공한 모습이다. 

 

 

 

위 내용 관련 AWS 가이드 

https://docs.aws.amazon.com/ko_kr/elasticbeanstalk/latest/dg/iam-instanceprofile.html

 

* 참고

이전에 Elastic Beanstalk는 AWS 계정이 처음으로 환경을 생성할 때 이름이 
aws-elasticbeanstalk-ec2-role인 기본 EC2 인스턴스 프로파일을 생성했습니다. 
이 인스턴스 프로파일에는 기본 관리형 정책이 포함되었습니다. 계정에 이미 
이 인스턴스 프로파일이 있는 경우 사용자 환경에 계속 할당할 수 있습니다.

그러나 최근 AWS 보안 지침에서는 AWS 서비스가 다른 AWS 서비스(이 경우 EC2)에 
대한 신뢰 정책을 사용하여 역할을 자동으로 생성하는 것을 허용하지 않습니다. 
이러한 보안 지침 때문에 Elastic Beanstalk는 더 이상 기본 aws-elasticbeanstalk-ec2-role 
인스턴스 프로파일을 생성하지 않습니다.
 

 

--> 위 내용을 보니 기존에는 일라스틱 빈스톡 서비스 생성 시 " ws-elasticbeanstalk-ec2-role"

을 기본생성 하였었는데  정책이변경되어 수기로 직접만들어줘야 하도록 변경되었나보다. 

책에서는 위 내용이 없어서 좀 헤맸다. ㅎㅎ 

Comments