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.
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
Thanks to @luk2302 for giving the tip.