Elastic Beanstalk, Unable to assume role "arn:aws:iam::********:role/aws-elasticbeanstalk-service-role". Verify that the role exists and is configured correctly.

0

One of My Beanstalk environment started to be in sever/degraded status and showing me the error

Unable to assume role "arn:aws:iam::******:role/aws-elasticbeanstalk-service-role". Verify that the role exists and is configured correctly.

Upon checking, there is nothing changed in this service role, and all my other EB enviornment using this service role works fine. The service role has two managed policis (AWSElasticBeanstalkEnhancedHealth & AWSElasticBeanstalkService) attached with proper trust relashionship setup as below. I also confirmed my USER IAM policy is Admin, which give access to do anything (including assume/pass roles). What else can be causing this error? How do I fix it

{ "Version": "2012-10-17", "Statement": [ { "Sid": "", "Effect": "Allow", "Principal": { "Service": "elasticbeanstalk.amazonaws.com" }, "Action": "sts:AssumeRole", "Condition": { "StringEquals": { "sts:ExternalId": "elasticbeanstalk" } } } ] }

3개 답변
1

I have had the same issue as yours and I was able to fix when I chose to create new role as defined by Elastic Beanstalk. My first attempt was to add the "AWSElasticBeanstalkManagedUpdatesCustomerRolePolicy" policy in the role for my website but it didn't fix the issue though I restart the environment. After many troubleshooting workarounds done to no avail, I resorted to create a new environment and I chose "Create and use new service role" in the Service Role. I just let "aws-elasticbeanstalk-service-role" to autofill "Existing service roles" and just follow the prompts thereafter.

profile picture
Vin
답변함 9달 전
  • Really appreciate for your genius solution. I tried several times to conque this issue. I trust this is AWS issue.... but not able to reported a case with technical issue.

0

Hi,

From the case notes I understand that you are getting the error Unable to assume role "arn:aws:iam::xxxxxx:role/aws-elasticbeanstalk-service-role", in your elastic beanstalk environment.

Per the Elastic Beanstalk documentation the trust policy that you have for your service role is correct. I am attaching the following documentation for that here (1). After testing I was not able to replicate this issue in my account as Elastic Beanstalk was successfully able to assume the service role with this trust policy. Based off of this I would recommend opening a case with AWS support in order to allow a support engineer to better troubleshoot the issue.

I hope you have a great rest of your day!

References

(1) https://docs.aws.amazon.com/elasticbeanstalk/latest/dg/iam-servicerole.html#iam-servicerole-console

AWS
지원 엔지니어
답변함 2년 전
  • Same problem with my Elastic Beanstalk

0

I had this same problem, to fix it I just created a new role, instead of using the default role option.

template.yml:

AWSTemplateFormatVersion: '2010-09-09'
Description: CloudFormation template to create a service-linked role for Elastic Beanstalk

Resources:

  ElasticBeanstalkServiceRole:
    Type: 'AWS::IAM::Role'
    Properties:
      RoleName: 'cicd-role'
      AssumeRolePolicyDocument:
        Version: '2012-10-17'
        Statement:
          - Effect: 'Allow'
            Action: 'sts:AssumeRole'
            Principal:
              Service: 'elasticbeanstalk.amazonaws.com'
      Description: 'Allows Elastic Beanstalk to create and manage AWS resources on your behalf.'
      ManagedPolicyArns:
        - arn:aws:iam::aws:policy/AdministratorAccess-AWSElasticBeanstalk
        - arn:aws:iam::aws:policy/service-role/AWSElasticBeanstalkEnhancedHealth
        - arn:aws:iam::aws:policy/service-role/AWSElasticBeanstalkService

Outputs:
  RoleArn:
    Description: 'ARN of the Elastic Beanstalk service role'
    Value: !GetAtt [ElasticBeanstalkServiceRole, Arn]

Or in the aws Management Console:

  • Roles > Create
  • Trusted entity type > AWS service
  • Use case > Elastic Beanstalk
  • (Everything else as default)
  • Create
답변함 6달 전

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠