Better HN
topnewbestaskshowjobs
Log inSign up

mtrainier12345

1 karma · joined Oct 26, 2022 (4y ago) · 1 submissions

Submissions

comment 4y ago · link · parent

There's actually an AWS API that does that. That's create-fleet in 'instant' mode. Docs are here: https://docs.aws.amazon.com/cli/latest/reference/ec2/create-... In short, you create a request specifying your CPU and memory constraints (you can also specify other constraints like processor manufacturer, memory per vCPU, etc). Then select lowest-price allocation strategy, and fleet "--type instant". Fleet will make a synchronous request provisioning the currently cheapest instance(s) which satisfy the constraints you selected, and will respond with the instance IDs.