July 2018
Intermediate to advanced
350 pages
8h 47m
English
The following SAM template creates AWS Lambda Function and Amazon API Gateway resources. API Gateway is configured to proxy GET requests on the /hotels endpoint to the Lambda function. The template also gives the Lambda access to write to the DynamoDB table that gets created. It gives it CRUD access:
SearchHotelsIngestionFunction:
Type: AWS::Serverless::Function
Properties:
CodeUri: .
Handler: index.handler
Runtime: nodejs8.10
Policies:
- DynamoDBCrudPolicy:
TableName: !Ref HotelsListDynamoDB
Events:
SearchHotelsIngestion:
Type: Api
Properties:
Path: /
Method: get
Read now
Unlock full access