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

How to get the ApiId without explicitly creating an AWS::Serverless:Api resource?

Open rowanu opened this issue 8 years ago • 2 comments

I want to create my API endpoints via function-based definitions (i.e. in the Events property), not via a Swagger definition.

I know I don't need to create a AWS::Serverless::Api resource, because the API Gateway RestApi will be created for me, but without that resource I can't find a way to get the created API's Id.

rowanu avatar Dec 13 '17 22:12 rowanu

The implicitly created resource is called ServerlessRestApi

You can see an example of its usage here: https://github.com/awslabs/serverless-application-model/blob/master/examples/2016-10-31/encryption_proxy/template.yaml#L17

prestomation avatar Dec 15 '17 03:12 prestomation

Thanks very much! Just saw #222 is already open, so will follow that.

rowanu avatar Dec 15 '17 06:12 rowanu