https://aws.amazon.com/getting-started/serverless-web-app/
https://cloudonaut.io/create-a-serverless-restful-api-with-api-gateway-swagger-lambda-and-dynamodb/
Cloudformation creates everything except for API Gateway, Swagger with API Gateway extension creates API Gateway, that maps operation with parameters (kind of smart move). Model - defined in Swagger. although example did not enable verify body, can be enabled with just one click. And the verification is done by cloudfront.
Swagger is replaced by OpenAPI, so bit out dated. Also involve multiple steps with cloudformation stack update. Not the best choice.
Serverless framework seems make things easy but it's not AWS native. Why should I learn one more thing which is not native?
Native. Everything from cloudformation. Should study this one.
AWS Serverless Application Model (AWS SAM)
Simplified template to define serverless applications. Translate to CloudFormation (if a stack is deployed with SAM, can find the translated cloudformation template on console). Only a subset of CF template, only deals with (as of July 2018) lambda, API Gateway, cognito, DynamoDB, etc.
SAM Local is a tool to (1) initialize serverless application project (2) debug lambda locally (3) uses SAM model definition (4) but as to July 2018 only deals with lambda and ignore other resources. (5) package - but cannot specify name, and deploy, by calling "aws cloudformation deploy", first upload to s3
SAM can be used with swagger together to define Api. However, in that case,
CloudFormation template (according to this discussion) works great and give complete power, however may be overwhelming to beginners. SAML with examples leads user to resources needed.
Serverless Framework seems also has a way to define serverless application, and far less verbose than SAM (see discussion here). Still not so sure about it. Another comparison (https://sanderknape.com/2018/02/comparing-aws-sam-with-serverless-framework/) seems suggest SAM better than Serverless Framework. There is a project "serverless-sam" to convert serverless template to SAM template.
Swagger (OpenAPI Specification) "defines a standard, language-agnostic interface to RESTful APIs which allows both humans and computers to discover and understand the capabilities of the service ... a consumer can understand and interact with the remote service with a minimal amount of implementation logic."; there are lots of tools (tooling ecosystem) surrounding the specification. Swagger can be used to create API Gateway for REST API. SAM can use Swagger to describe AWS::Serverless::Api (otherwise SAM can use Events in AWS::Serverless::Function to implicitly define API). CloudFormation also can use Swagger to create API Gateway for REST API. However at this moment (July 2018) Swagger cannot generate client for OpenAPI 3.0, and CloudFormation still only accept swagger 2.0.
Project scaffolding:
Cloudformation template:
API-Gateway swagger files:
Dynamodb Tables:
Lambda
Api-Gateway / Lambda proxy: