Вы также можете сделать это с флагом KeepJobFlowAliveWhenNoSteps.
response = emr.run_job_flow(
Name="start-my-cluster",
ReleaseLabel="emr-5.3.1",
LogUri='s3://logs',
Instances={
'InstanceGroups': [
{'Name': 'EmrMaster',
'InstanceRole': 'MASTER',
'InstanceType': 'm3.xlarge',
'InstanceCount': 1},
{'Name': 'EmrCore',
'InstanceRole': 'CORE',
'InstanceType': 'm3.xlarge',
'InstanceCount': 2}
],
'Ec2KeyName': 'my-key-name',
'KeepJobFlowAliveWhenNoSteps' : True,
},
Applications=[{'Name': 'Hadoop'}, {'Name': 'Spark'}, {'Name': 'Hive'}],
JobFlowRole='EMR_EC2_DefaultRole',
ServiceRole='EMR_DefaultRole',
VisibleToAllUsers=True,
Steps=[
# steps go here...
]
)