How can I launch an EMR using SPOT Block using boto?

Viewed 458

How can I launch an EMR using spot block (AWS) using boto ? I am trying to launch it using boto but I cannot find any parameter --block-duration-minutes in boto, I am unable to find how to do this using boto3.

2 Answers

According to the boto3 documentation, yes it does support spot blocks.

BlockDurationMinutes (integer) -- The defined duration for Spot instances (also known as Spot blocks) in minutes. When specified, the Spot instance does not terminate before the defined duration expires, and defined duration pricing for Spot instances applies. Valid values are 60, 120, 180, 240, 300, or 360. The duration period starts as soon as a Spot instance receives its instance ID. At the end of the duration, Amazon EC2 marks the Spot instance for termination and provides a Spot instance termination notice, which gives the instance a two-minute warning before it terminates.

Iniside the LaunchSpecifications dictionary, you need to assign a value to BlockDurationMinutes. However, the maximum value is 360 (6 hours) for a spot block.

Related