admin管理员组

文章数量:1289583

I'm trying to stand up a new cluster in AWS EMR, but it immediately fails with the following error:

Service-linked role 'AWSServiceRoleForEMRCleanup' for EMR is required. Please create this role directly or add permission to create it in your IAM entity.

My service role for EMR has the following permission:

  - Effect: Allow
    Action:
      - iam:CreateServiceLinkedRole
      - iam:PutRolePolicy
    Resource:
      - "arn:aws:iam::<account-id>:role/aws-service-role/elasticmapreduce.amazonaws/AWSServiceRoleForEMRCleanup"

I've tried using * as the resource as well, which produces the same results.

I have also attempted to create the role directly as the error suggests, but that fails due to AWSServiceRole being a reserved prefix for role names created by AWS.

I'm trying to stand up a new cluster in AWS EMR, but it immediately fails with the following error:

Service-linked role 'AWSServiceRoleForEMRCleanup' for EMR is required. Please create this role directly or add permission to create it in your IAM entity.

My service role for EMR has the following permission:

  - Effect: Allow
    Action:
      - iam:CreateServiceLinkedRole
      - iam:PutRolePolicy
    Resource:
      - "arn:aws:iam::<account-id>:role/aws-service-role/elasticmapreduce.amazonaws/AWSServiceRoleForEMRCleanup"

I've tried using * as the resource as well, which produces the same results.

I have also attempted to create the role directly as the error suggests, but that fails due to AWSServiceRole being a reserved prefix for role names created by AWS.

Share Improve this question asked Feb 19 at 21:50 FoxMulder900FoxMulder900 1,29113 silver badges28 bronze badges
Add a comment  | 

1 Answer 1

Reset to default 0

The solution was to add the CreateServiceLinkedRole permission to the IAM role of the user making the calls, NOT the EMR service role.

本文标签: amazon iamHow can I allow an AWS EMR Cluster to create servicelinked rolesStack Overflow