Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

AWS Elastic Beanstalk: Environment Fails to Launch

I have created a few environments before so I know how the Amazon EBS works however lately I have been having the following issue while creating an environment:

The instance profile aws-elasticbeanstalk-ec2-role associated with the environment has no role. Please attach a role to the instance profile.

I follow the steps to create a new environment. When it gets to the Permissions page, I create a new role as there are no existing ones. Then I follow the rest of the steps and eventually it starts to launch. After a couple minutes, I get the error above. Any help towards this will be helpful.

like image 814
Bhavik P. Avatar asked Sep 13 '25 22:09

Bhavik P.


2 Answers

To solve this issue, I created a new role from the IAM Manager console. I selected Amazon EC2 as my Service Role Type. I attached the AWSElasticBeanstalkFullAccess policy. Then when creating a new environment, I chose the new role I created.

like image 142
Bhavik P. Avatar answered Sep 16 '25 11:09

Bhavik P.


Though I am bit late in answering this issue, posting here if someone faces this error now.

In case your user has all the required permission to create role and BS has already created the "The instance profile aws-elasticbeanstalk-ec2-role".

The reason of this error is due to roles only and when we try to launch EC2 from aws BS, it creates a role naming "aws-elasticbeanstalk-ec2-role" with required permissions.

But, if there is already a role with Trusted entities "AWS service: ec2" so BS will check permission in that already existing older role.

So go to Roles > Search ec2 related roles and select the role which is active.

And just add AWSElasticBeanstalkFullAccess permission to that ec2 role, and this issue will be resolved.

like image 42
ASin Avatar answered Sep 16 '25 12:09

ASin