Launch EMR in a VPC using boto

280 views
Skip to first unread message

AMAL G JOSE

unread,
Oct 9, 2014, 8:21:48 AM10/9/14
to boto-...@googlegroups.com
Hi,

I want to launch an EMR in a custom VPC using boto.
I am able to launch EMR in the default VPC, but I haven't seen any option in boto api for specifying the VPC. 
 Can anyone help me regarding this.?

Regards,
Amal G Jose

AMAL G JOSE

unread,
Oct 14, 2014, 9:10:07 AM10/14/14
to boto-...@googlegroups.com
I found the solution.
In the current versions of boto there is no direct option to specify the subnet for launching EMR.
So we can pass the subnet id as an argument to the api_params option in the run_jobflow method of EmrConnection.
Pass Instances.Ec2SubnetId parameter and the value of this parameter as subnet-xxx as a parameter dictionary to the api_params argument in the run_jobflow method.
It worked perfectly for me.


Regards,
Amal G Jose

Vinod Krishnan

unread,
Oct 30, 2014, 6:20:52 AM10/30/14
to boto-...@googlegroups.com
Thanks Amal . It worked for me as well

Le Chen

unread,
Feb 28, 2015, 11:00:02 AM2/28/15
to boto-...@googlegroups.com
Thanks.
In case some find this post useful, here's the codes.

  api_params = {"Instances.Ec2SubnetId":subnet_id}

  #Launching the cluster
  cluster_id = conn.run_jobflow(
               name,
               ec2_keyname=AWS_EC2_KEY_NAME,
               steps=[],
               keep_alive=False,
               master_instance_type = instance_type,
               slave_instance_type = instance_type,
               num_instances=2,
               ami_version=ami_version,
               api_params=api_params)
Reply all
Reply to author
Forward
0 new messages