Skip to content
v2.274.0

AllocationStrategy Enum ​

Determines how this compute environment chooses instances to spawn.

Example ​

ts
declare const vpc: ec2.IVpc;

const computeEnv = new batch.ManagedEc2EcsComputeEnvironment(this, 'myEc2ComputeEnv', {
  vpc,
  allocationStrategy: batch.AllocationStrategy.BEST_FIT,
});

Members ​

MemberDescription
BEST_FITBatch chooses the lowest-cost instance type that fits all the jobs in the queue.
BEST_FIT_PROGRESSIVEThis is the default Allocation Strategy if spot is false or unspecified.
SPOT_CAPACITY_OPTIMIZEDIf your workflow tolerates interruptions, you should enable spot on your ComputeEnvironment and use SPOT_CAPACITY_OPTIMIZED.
SPOT_PRICE_CAPACITY_OPTIMIZEDThe price and capacity optimized allocation strategy looks at both price and capacity to select the Spot Instance pools that are the least likely to be interrupted and have the lowest possible price.

Referenced by ​