InstanceProfile is required for creating cluster - create python function to install module

1.1k views Asked by At

Im using elastic mapreduce with boto.

Everything was working fine, but since this week Im getting this error:

InstanceProfile is required for creating cluster

Im trying to fix this issue, and it seems that now we need to create a default role for elastic map reduce.

And I did this using awscli, with this commands below, but there isnt other way to do this (for example with boto)?

If there isnt other way it is possible to create for example a python function, that execute this 3 commands below?

1 - pip install awscli

2 - aws configure

3 - aws emr create-default-roles

Ater use this commands above I also needed to add in mapreduce job function this:

ami_version="2.4.9",
job_flow_role="EMR_EC2_DefaultRole",
service_role="EMR_DefaultRole"
2

There are 2 answers

0
ChristopherB On BEST ANSWER

The creation of roles for EMR (for example, the default roles) only need to be done once per account per region. This is not a step that will need to performed regularly. If you wanted to create the roles via boto one could manually create the roles using the IAM API (http://boto.readthedocs.org/en/latest/ref/iam.html) and build the roles in accordance with the default policies as defined at http://docs.aws.amazon.com/ElasticMapReduce/latest/DeveloperGuide/emr-iam-roles-defaultroles.html

0
Jerome Anthony On

Run aws emr create-default-roles to create the default roles for the cluster before issuing the aws emr create-cluster command.