Given a template:
AWSTemplateFormatVersion : '2010-09-09'
Transform: AWS::Serverless-2016-10-31
Resources:
VoteSpacesTabs:
Type: "AWS::Serverless::Function"
Properties:
Runtime: python3.6
Handler: lambda_function.lambda_handler
Policies: AmazonDynamoDBFullAccess
Environment:
Variables:
TABLE_NAME: !Ref VotesTable
Events:
Vote:
Type: Api
Properties:
Path: /vote
Method: post
Invoking:
sam validate
returns:
Valid!
Should it return valid given that we have no code-uri or other required attributes? What exactly is it validating?
Given this template:
AWSTemplateFormatVersion : '2010-09-09'
Transform: AWS::Serverless-2016-10-31
Resources:
VotesTable:
Type: "AWS::Serverless::SimpleTable"
VoteSpacesTabs:
Type: "AWS::Serverless::Function"
Properties:
Runtime: python3.6
Handler: lambda_function.lambda_handler
Policies: AmazonDynamoDBFullAccess
Environment:
Variables:
TABLE_NAME: !Ref VotesTable
Events:
Vote:
Type: Api
Properties:
Path: /vote
Method: post
Invoking
sam validate
Returns:
ERROR: Failed to read the resources line numbers. This usually means that the template contains invalid indentation. Please check it and try again
This error message isn't helpful in determining what's wrong. I still haven't figured out what's wrong.
However both templates are valid from the point of view of cloudformation:
aws cloudformation validate-template --template-body file://template.yaml
Given a template:
Invoking:
sam validatereturns:
Valid!
Should it return valid given that we have no code-uri or other required attributes? What exactly is it validating?
Given this template:
Invoking
sam validateReturns:
ERROR: Failed to read the resources line numbers. This usually means that the template contains invalid indentation. Please check it and try againThis error message isn't helpful in determining what's wrong. I still haven't figured out what's wrong.
However both templates are valid from the point of view of cloudformation:
aws cloudformation validate-template --template-body file://template.yaml