Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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"
like image 756
techman Avatar asked Mar 18 '26 20:03

techman


2 Answers

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

like image 114
Jerome Anthony Avatar answered Mar 21 '26 10:03

Jerome Anthony


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

like image 37
ChristopherB Avatar answered Mar 21 '26 09:03

ChristopherB