Search code examples
amazon-web-servicesamazon-elastic-beanstalk

AWS Elastic Beanstalk Error when creating environment. "There are no instances. Unable to assume role XXXXX."


I'm trying to understand how to use AWS Beanstalk. But I'm struggling to find out the proper policies to make it work when creating Service Roles and Instance Profiles. It's a ruby application.

This is my error when creating an environment. Before I had another error about Managed Updates, which was solved after adding the right policy.

Environment health has transitioned from Pending to Warning. Initialization in progress (running for 2 minutes). There are no instances. Unable to assume role "arn:aws:iam::149413950731:role/elasticbeanstalk-admin-role-services". Verify that the role exists and is configured correctly.

I tried rebuild the environment after updating the roles, still having the same problem.

I'm using a user with PoweruserAccess.

This is the list of roles: Roles

Here are the Service Role policies selected: Service Role

And the Instance Profile: Instace Profile


Solution

  • To solve this, I went to IAM Roles, after entering the specific role related to the error message, I edited the principal inside the Trusted Entity.

    Changed the "Principal: Service:" to elasticbeanstalk.amazonaws.com

    Before was ec2.amazonaws.com

    enter image description here

    Thanks to @luk2302 for giving the tip.