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.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With