Creating Serverless application using SAM Part2
There are two ways to create API gateway resource using SAM template. These two types are called explicit API definition and implicit API definition. An explicit API gateway creation involves defining the resource explicitly with type AWS::Serverless::API In this type we give the API resource some name and thus we have an handle to the API. An implicit API gateway involves defining the end points for API as part of the serverless function event definition. There is no separate API gateway resource defined. As part of SAM deployment, all the endpoints are collected and a new API gateway resource is automatically created by the SAM. Implicit API Gateway Using our previous example where we created lambda function, we add few more properties as shown in the below snippet which creates an API gateway resource Explicit API Gateway example As we see that we don't have control with implicit API gateway. Also it is not possible to create a custom stage name for implicit ...