Skip to content

Refactor for the CLI endpoints outputs - #1794

Merged
flomotlik merged 1 commit into
serverless:masterfrom
nicka:feature/refactor-aws-cloudformation-endpoint-outputs
Aug 11, 2016
Merged

flomotlik merged 1 commit into
serverless:masterfrom
nicka:feature/refactor-aws-cloudformation-endpoint-outputs

Conversation

@nicka

@nicka nicka commented Aug 8, 2016 •

Copy link
Copy Markdown
Contributor
Status:

Ready

Description:

The CLI output behaviour is still the same. Difference is that this PR exposes only one single API gateway endpoint through the CloudFormation outputs named ServiceEndpoint. It loops through the functions array to setup the paths(with the ServiceEndpoint) for the CLI output.

Why? CloudFormation has a limit of 60 outputs per stack, less outputs by the framework is more outputs for the user. It's also common to expose one single endpoint for a service.

My personal believe is that the existing outputs where only formatted this way to nicely display all your paths from the CLI output. But the Output value's itself weren't very usable because of the value > GET - https://foo. Our common use case is to use the ServiceEndpoint output to connect stacks together. Example: A CloudFormation stack which only contains a CloudFront distribution with multiple origins to each ServiceEndpoint.

Todos:
  • Write tests

@pmuens pmuens added this to the v1.0.0-beta.2 milestone Aug 8, 2016
@pmuens

pmuens commented Aug 8, 2016

Copy link
Copy Markdown
Contributor

Nice one @nicka 🎉
Really like this PR as it prevents problems if one has too many outputs.

Could you maybe look through the docs and update them (e.g. the example in the README.md file in lib/plugins/info).

Great work! 👍

@nicka

nicka commented Aug 8, 2016

Copy link
Copy Markdown
Contributor Author

@pmuens Thanks! Updated the README.md's 🎉

@pmuens

pmuens commented Aug 9, 2016

Copy link
Copy Markdown
Contributor

@nicka awesome! Love your eye for the details!

GTM from my side :shipit: . @eahefnawy @flomotlik could you guys take a look into this as well

@nicka

nicka commented Aug 9, 2016

Copy link
Copy Markdown
Contributor Author

@pmuens Fixing some small typos in the README.md.

@flomotlik

Copy link
Copy Markdown
Contributor

@pmuens please review with various http configs just to make sure this works with string and object notation. Other than that it looks REALLY good :D

@pmuens

pmuens commented Aug 11, 2016

Copy link
Copy Markdown
Contributor

@flomotlik Yep will review it in detail! Will report back once I'm done!

@pmuens

pmuens commented Aug 11, 2016 •

Copy link
Copy Markdown
Contributor

Just tested this PR locally with some different HTTP event definitions.

Works without a single problem. Great job @nicka 🎉 💃 Love this refactoring as it produces the exact same output but with less usage of CloudFormation output variables 👍

Just noticed the the function ARN outputs are separated like the endpoints before this PR. Maybe worth to refactor this as well (but in another PR). What do you think @nicka ?

Edit: Just opened up an issue for this one --> #1825

GTM from my side :shipit:

/cc @eahefnawy @flomotlik

@flomotlik
flomotlik merged commit 2a97b5b into serverless:master Aug 11, 2016
@nicka
nicka deleted the feature/refactor-aws-cloudformation-endpoint-outputs branch August 11, 2016 20:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants