Last active
January 5, 2016 18:26
-
-
Save dedunumax/f362c3a17a9027ebed2b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import boto.emr | |
import boto.exception | |
from boto.emr.instance_group import InstanceGroup | |
__author__ = 'dedunu' | |
connection = boto.emr.connect_to_region( | |
region_name='us-east-1', | |
aws_access_key_id='<Your AWS Access Key>', | |
aws_secret_access_key='<You AWS Secred Key>', | |
) | |
api_params = { | |
'ReleaseLabel': 'emr-4.2.0' | |
} | |
instance_groups = list() | |
instance_groups.append(InstanceGroup( | |
num_instances=1, | |
role="MASTER", | |
type='m1.large', | |
market="ON_DEMAND", | |
name="Master nodes")) | |
instance_groups.append(InstanceGroup( | |
num_instances=1, | |
role="CORE", | |
type='m1.large', | |
market="ON_DEMAND", | |
name="Slave nodes")) | |
cluster_id = connection.run_jobflow( | |
name='test_emr_job_with_release_label', | |
availability_zone='us-east-1a', | |
instance_groups=instance_groups, | |
# ami_version='3.0.0', | |
enable_debugging=False, | |
visible_to_all_users=True, | |
keep_alive=True, | |
job_flow_role="EMR_EC2_DefaultRole", | |
service_role="EMR_DefaultRole", | |
api_params=api_params, | |
) | |
print (cluster_id) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment