-
Notifications
You must be signed in to change notification settings - Fork 302
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Keeping instance type list up-to-date per region #341
Comments
Is there any updates on this one? |
I think I can work on this in the next days |
Hi @made2591! Thanks for your interest! If you end up working on this, could you please submit a design document so we can discuss options? Thanks! |
Sure! I will work on it and share with you before starting: I already have an idea about how to solve it, but I didn’t have time yet to formalize it. Stay tuned, I will post it here asap! |
Hi @SoManyHs, It seems there's no API for getting available family instance types in respective region (am I wrong?). The idea I had in mind was to load them from AWS exposed price endpoints: in fact, as soon as a new instance family is available in a region, AWS is obliged to expose the price for it as well. These prices are available here for each region with the specified endpoint (you can even ask for all of them in one time, but it would take too much time to download ~700Mb of data). The endpoints for each region are formatted in this way:
So, given a region, you can build the endpoint with price list for each family for the specific region (example: eu-west-1):
and thus by parsing this information inside a proper struct, you can have an always-updated list of available family instances in a given region. As a side effect, this will cost the time of making two HTTP get requests: the first one is pretty fast to complete because data to be downloaded are in the order of 4kb. The second call will require more time - unfortunately, you cannot project the only information you want (GraphQL would be perfect for this, imho) - but still would be faster then waiting for cloudformation fails I guess 🤔. If this approach works, we can even then extended it with a cache mechanism that updated a local store after failure, to avoid the download of prices in every deploy and let the process be fast until the next failure. For what concerns how to implement this solution, I just started having a look at the code: I don't know if this can be integrated as a service in cloudformation module and then call it during the retrieve/validation chain of the parameters (like in the function retrieveInstanceType). Makes sense? It's just an idea, I didn't explore it or made a test still, just want to share with you the overall approach ^^ What do you think about this? |
Resolved by #958 |
We need a better way of keeping our list of available EC2 instances up-to-date in our CloudFormation template (related pull requests: #339 and #340), as well as communicate which instance types are valid in a given region.
http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instance-types.html#AvailableInstanceTypes
The ECS Console currently only lists instance types available in all regions in the Create Cluster wizard dropdown, but the CLI has always allowed all instance types regardless of region. If an instance type that is not supported in a given region is specified, the request will fail:
Ideally, we should know which instance types are valid per region and fail fast rather than waiting for the issue to bubble up through Cloud Formation.
The text was updated successfully, but these errors were encountered: