amazon-web-servicesamazon-elastic-beanstalkspot-instances

How can I specify that I only want Spot Instances for my Elastic Beanstalk application?


My env.yaml has:

  aws:ec2:instances:
    InstanceTypes: g4dn.xlarge,c5.4xlarge,r5.2xlarge,r5a.xlarge
    EnableSpot: true
    SpotMaxPrice: "0.15"

but when I do eb create, it still asks me:

Would you like to enable Spot Fleet requests for this environment?
(y/N): y
Enter a list of one or more valid EC2 instance types separated by commas (at least two instance types are recommended).
(Defaults provided on Enter):

Why is it not respecting the env.yaml file?


Solution

  • To specify that you don't want any on-demand instances you can use SpotFleetOnDemandBase and SpotFleetOnDemandAboveBasePercentage:

    The use of the options is exemplified in Example 2. Specifically, if both options are set to 0, no on-demand instances will be used.