Skip to content
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

Generate X-Servers listing all valid AWS service endpoints #16

Open
wants to merge 2 commits into
base: master
from

Conversation

Projects
None yet
2 participants
@pimterry
Copy link
Contributor

pimterry commented Apr 4, 2019

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 (amazonaws.com.cn) for every service, for example.

I've done some testing, and it all seems to work out very nicely: sqs.amazonaws.com is no longer valid but sqs.us-east-1.amazonaws.com is now included, ec2 allows both ec2.amazonaws.com and ec2.{region}.amazonaws.com server formats, etc.

Conversion later on with swagger2openapi also works great too.

@pimterry pimterry force-pushed the pimterry:region-servers branch from a57ebbb to 8ee2345 Apr 15, 2019

@MikeRalphson

This comment has been minimized.

Copy link
Contributor

MikeRalphson commented Apr 17, 2019

Re: your point

using an explicit npm dep on the SDK to get hold of it - debatable, but that seemed the easiest route

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.

@pimterry pimterry force-pushed the pimterry:region-servers branch from c365991 to 558ed2b Apr 18, 2019

@pimterry

This comment has been minimized.

Copy link
Contributor Author

pimterry commented Apr 18, 2019

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.