Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.Sign up
Generate X-Servers listing all valid AWS service endpoints #16
This fixes #14.
It extracts the logic & region config from the SDK (using an explicit npm dep on the SDK to get hold of it - debatable, but that seemed the easiest route), gets a list of all AWS regions, and then iterates over them to work out the set of valid URL patterns for each service. The resulting server URLs include variable params, and generate variable definitions with an enum listing each of the valid regions for that URL format. Trickier than it sounds - note that China have a totally separate base host (
I've done some testing, and it all seems to work out very nicely:
Conversion later on with swagger2openapi also works great too.
Re: your point
I'm instinctively against this for two reasons, one: size and two: keeping it up-to-date. We already point to a checked-out copy of the js-sdk to get the API definitions, could we not require the necessary modules from there too? Let me know if that wouldn't work for you though.
Ok, sure, if you'd prefer that route. Personally by default I'd aim to move away from the checked-out SDK copy, and use only an npm dependency, since it makes the local setup easier and feels a little tidier, but it's not a big thing, up to you.
For now I've pushed an extra commit that drops the dependency completely, and uses the referenced SDK files instead.