Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Error with Instance profile role for EMR?

I am trying to build an EMR cluster through terraform. But I am getting following error on applying the code. IAM_EMR_for_EC2 is the instance profile role I created for EC2 in the cluster to assume.

1 error(s) occurred:

  • aws_emr_cluster.tf-test-cluster: 1 error(s) occurred:

  • aws_emr_cluster.tf-test-cluster: ValidationException: Instance profile 'arn:aws:iam:::role/IAM_EMR_for_EC2' is not well-formed. Expected a resource of type INSTANCE_PROFILE. status code: 400, request id: 6bd4461c-637f-11e8-8605-c930816c10b8

Could someone help me as I am not able to understand this error nor I could it find any details on google.

like image 766
Ash Panwar Avatar asked Oct 27 '25 19:10

Ash Panwar


1 Answers

You're applying a role rather than an instance profile, they are actually different. The ARN needs to be in the format of arn:aws:iam::336924118301:instance-profile/ExampleInstanceProfile.

A role needs to be attached to an instance profile resource.

like image 92
d1ll1nger Avatar answered Oct 30 '25 08:10

d1ll1nger