user2714823
user2714823

Reputation: 605

Amazon EC2 cluster error Failed to provision ec2 instances because 'The requested instance profile EMR_EC2_DefaultRole is invalid'

I am trying to create a cluster using amazon aws console with default role.The cluster gets created and it remains in starting state for sometimes and then terminated with this error:- Failed to provision ec2 instances because 'The requested instance profile EMR_EC2_DefaultRole is invalid'

I tried editing user Trust relationship of Default Role but again it says not authorized.ALso,I have logged in as root account.

Upvotes: 4

Views: 6255

Answers (2)

rmmjohann
rmmjohann

Reputation: 141

Came across this issue when creating an EMR cluster with terraform. The custom EC2 instance profile and its IAM role must be named the same, otherwise the creation fails with error

Failed to provision ec2 instances because 'The requested instance profile <iam_role_name> is invalid'

The iam role got the relevant policy arn:aws:iam::aws:policy/service-role/AmazonElasticMapReduceforEC2Role attached and the output of EMR_EC2_DefaultRole looks the same as the created role, except that role and instance profile are named differently.

It's weird because if you name instance profile and IAM role differently and the cluster will be created within amazon management console, the relevant instance profile can be chosen from the dropdown - which leads to the mentioned error, too.

For now I didn't get it managed to assign custom EMR service and autoscaling roles successfuly.

Upvotes: 1

TheSPD
TheSPD

Reputation: 177

I had a similar problem when I was trying to follow the documentation of EMR.

I solved it by: 1. Creating a user in AWS Identity and Access Management(IAM). 2. After I assigned this user to a 'group'(Create a new group). 2a. The group should have the roles that are being used(S3 and EMR). - Click on attachments and select all the ones are not 0.

I hope this helps you.

Upvotes: 6

Related Questions