Search code examples
aws-cliemr

Errors trying to resize instance group with aws cli


I have a standing EMR cluster and a daily job I want to run. I was trying to use the aws cli to resize the cluster, with the plan of adding this to the crontab so the cluster would grow and then shrink later. (I don't have ability for auto-scaling, so that's out)

I have read the Amazon documentation and the examples they give don't work. I've tried the natural variations, but end up getting nowhere.

According to the documentation, the command is

aws emr modify-instance-groups --instance-groups InstanceGroupId=ig-31JXXXXXXBTO,InstanceCount=4

However, when I try this with my own instance ID, i get:

Error parsing parameter '--instance-groups': Expected: '<second>', received: '<none>' for input:InstanceGroupId=ig-31JXXXXXXBTO,

I've tried doing things like removing the instance count, hoping for more documentation...

aws emr modify-instance-groups --instance-groups InstanceGroupId=ig-WCXEP0AXCGJS

which gives the response

An error occurred (ValidationException) when calling the ModifyInstanceGroups operation: Please provide either an instance count or a list of EC2 instance ids to terminate.

I've tried several variations without luck. Any ideas? Thanks.


Solution

  • I ended up submitting a trouble ticket through Amazon.

    The resize command requires that no space occur after the comma. The trouble shooter has reported this behavior and unhelpful error to the developers.

    aws emr modify-instance-groups --instance-groups InstanceGroupId=ig-31JXXXXXXBTO,InstanceCount=4
    

    will work, as long as there is no space after the comma. hopefully they'll either fix that or provide a better error message.