我正在尝试使用代码管道部署lambda,并使用sam yml进行代码部署,但是失败并出现以下错误: 失败-转换AWS :: Serverless-2016-10-31失败,原因是:无效的无服务器应用程序规范文档。发现的错误数量:1. SAM模板的结构无效。 “资源”部分为必填项
sam.yml是:
AWSTemplateFormatVersion: '2010-09-09'
Transform: 'AWS::Serverless-2016-10-31'
Description: Lambda1
Resources:
callDetails:
Type: 'AWS::Serverless::Function'
Properties:
Handler: lambda_function.lambda_handler
Runtime: python3.6
CodeUri: .
Description: 'Lambda Function'
MemorySize: 128
Timeout: 30
Role: 'arn:aws:iam::XXXXXX:role/YYYYYYYYY'
Environment:
Variables:
REGION: ap-southeast-2
buildspec.yml具有以下命令 -AWS cloudformation包---template-file samTemplate.yaml --s3-bucket XXXX --output-template-file outputSamTemplate.yaml
outputSamTemplate:
enter code here
AWSTemplateFormatVersion: '2010-09-09'
Description: Lambda Function
Resources:
callDetails:
Properties:
CodeUri: s3://TTTTTTTTTTTTT/CCCCCCCCC
Description: callDetails Lambda Function
Environment:
Variables:
REGION: ap-southeast-2
Handler: lambda_function.lambda_handler
MemorySize: 128
Role: arn:aws:iam::XXXXX:role/validationsLambdas
Runtime: python3.6
Timeout: 30
Type: AWS::Serverless::Function
Transform: AWS::Serverless-2016-10-31