amazon-web-servicesaws-clielastic-map-reduce

Error when creating aws emr default-roles


I'm trying to create a cluster using aws cli emr command. However, I can't seem to be able to create-default-roles needed before calling aws emr create-cluster

$ aws emr create-default-roles

A client error (NoSuchEntity) occurred when calling the GetRole operation: Unknown

I have made sure that my user has the following permissions:

IAMFullAccess - AWS Managed policy
AmazonElasticMapReduceforEC2Role - AWS Managed policy
AmazonElasticMapReduceFullAccess - AWS Managed policy

Any tips? Is there a place where I can just copy the roles json and create them manually?

The reason I started to do this is because when I run aws emr create-cluster it returns a cluster-id. But when that cluster-id is queries it state is set to terminated with the error: EMR service role arn:aws:iam::141703095098:role/EMR_DefaultRole is invalid


Solution

  • I DID manage to add these roles using the console by going to:

    My Security Credentials > Roles > Create New Role

    First Role with the following properties:

    name: EMR_DefaultRole
    policy: AmazonElasticMapReduceRole
    

    Second Role with the following properties:

    name: EMR_EC2_DefaultRole
    policy: AmazonElasticMapReduceforEC2Role
    

    Unfortunately I didn't get the command-line to work, but I suspect I might be something to do with my local setup.