Thursday, January 18, 2024

Fix AWS Elastic BeansTalk Roles Error

Removed

AWS Elastic Beanstalk is a service provided by Amazon Cloud in order to deploy and manage web application in a simple way. This post focus on an error that you can get when you try to create for the first time a beanstalk application and environment (dev, staging, production.


AWS Elastic Beanstalk


When working with Elastic Beanstalk, it's possible to have this error "aws-elasticbeanstalk-ec2-role doesn't exists when creating the environment". This is due to the fact that Amazon is no more creating the role and it should be manually added.

When creating an environment to run the application on EC2 instances, 2 roles are required. 

aws-elasticbeanstalk-service-role:

- AWSElasticBeanstalkManagedUpdatesCustomerRolePolicy 

- AWSElasticBeanstalkEnhancedHealth

aws-elasticbeanstalk-ec2-role:

- AWSElasticBeanstalkWebTier 

- AWSElasticBeanstalkWorkerTier

- AWSElasticBeanstalkMulticontainerDocker


so in order to fix the errors "No Environment found for EnvironmentName" and "aws-elasticbeanstalk-ec2-role doesn't exists when creating the environment", you should add the new rol in the IAM roles. To do so:

    - Open IAM console

    - Choose Roles and create a new Role

    - Choose "AWS Service" as  a trusted entity

    - For the use Case, use EC2

    - Attach AWSElasticBeanstalkWebTier, AWSElasticBeanstalkWorkerTier, and AWSElasticBeanstalkMulticontainerDocker.

    - Last, don't forget to create the Environment using the already created role for EC2.


AWS Beanstalk Role

No comments :

Post a Comment

Articles les plus consultés