serverless-application-model icon indicating copy to clipboard operation
serverless-application-model copied to clipboard

Getting stack output?

Open azarboon opened this issue 7 years ago • 4 comments

Description: To perform automatic integration tests on my project, somehow I need to get the api. There is already the plugin serverless-stack-output for Serverless framework that serves the purpose. But I would like to achieve similar thing by AWS SAM after I deploy my application.

Meanwhile, If I can somehow get my api's base url as well as individual endpoints, then I'm able to connect them and and perform tests against them.

Expected result:

To get API Gateway endpoints + other invocation channels in a json file.

azarboon avatar Aug 04 '18 14:08 azarboon

You can use the Outputs section of CloudFormation, and query for that using the API

brettstack avatar Aug 04 '18 18:08 brettstack

Thank you. Yes, and I'm now looking at backend example which does so.

But following that example's way, I should define separate "output" for each function. This can easily lead to a mess when there are many functions in the app. Is there any way to make it shorter syntax?

Also, each api endpoint (e.g. in this case its "/resource") should be written and updated manually. Which can is annoying. Is there any way or any !REF that can get URL endpoint?

azarboon avatar Aug 04 '18 21:08 azarboon

Agreed. I think it would be beneficial if SAM created some Outputs for you

brettstack avatar Aug 04 '18 23:08 brettstack

Updating labels.

jfuss avatar Aug 09 '21 21:08 jfuss