Skip to content
This repository has been archived by the owner on May 1, 2024. It is now read-only.

feat: Added ability to specify custom AMI for EMR. #94

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions batch/library/emr
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ class ElasticMapreduceCluster():
def get_boto_base_specs(self, arguments):
ami_version = arguments.pop('ami_version', DEFAULT_AMI_VERSION)
release_label = arguments.pop('release_label')
custom_ami = arguments.pop('custom_ami')
log_uri = arguments.pop('log_uri')
job_flow_role = arguments.pop('job_flow_role')
service_role = arguments.pop('service_role')
Expand Down Expand Up @@ -136,6 +137,9 @@ class ElasticMapreduceCluster():
if applications is not None:
parameters['NewSupportedProducts'] = self.get_boto_application_specs(applications)

if custom_ami:
parameters['CustomAmiId'] = custom_ami

return parameters

def get_boto_instance_specs(self, arguments):
Expand Down Expand Up @@ -526,6 +530,7 @@ def main():
log_uri = dict(default=None, type='str'),
ami_version = dict(type='str'),
release_label = dict(default=None, type='str'),
custom_ami = dict(default=None, type='str'),
visible_to_all_users = dict(type='bool'),
job_flow_role = dict(default=None, type='str'),
service_role = dict(default='EMR_DefaultRole', type='str'),
Expand Down
2 changes: 2 additions & 0 deletions batch/provision.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
- role: emr
- ami_version: 2.4.11
- release_label: ''
- custom_ami: ''
- vpc_subnet_id: !!null
- user_info: []
- log_uri: !!null
Expand All @@ -57,6 +58,7 @@
job_flow_role: "{{ role }}"
ami_version: "{{ ami_version }}"
release_label: "{{ release_label }}"
custom_ami: "{{ custom_ami }}"
instance_groups: "{{ instance_groups }}"
instance_fleets: "{{ instance_fleets }}"
bootstrap_actions: "{{ bootstrap_actions }}"
Expand Down