如何为CloudFront和AWS API网关WebSocket创建SAM模板



我正在努力寻找关于如何为CloudFront和AWS API网关WebSocket创建SAM模板的文档,过程和示例。

下面是来自https://docs.aws.amazon.com/lambda/latest/dg/services-apigateway-tutorial.html的Lambda应用程序的样例AWS SAM模板。将下面的文本复制到一个文件中,并将其保存在前面创建的ZIP包旁边。注意,HandlerRuntime参数值应该与您在上一节创建函数时使用的值相匹配。

AWSTemplateFormatVersion: '2010-09-09'
Transform: AWS::Serverless-2016-10-31
Resources:
LambdaFunctionOverHttps:
Type: AWS::Serverless::Function
Properties:
Handler: index.handler
Runtime: nodejs12.x
Policies: AmazonDynamoDBFullAccess
Events:
HttpPost:
Type: Api
Properties:
Path: '/DynamoDBOperations/DynamoDBManager'
Method: post

最新更新