Serverless-application-model: executing sam validate fails on serverless-application-model/examples/2016-10-31/api_backend/template.yaml

Created on 8 Feb 2020  路  2Comments  路  Source: aws/serverless-application-model

Description:


executing sam validate fails on serverless-application-model/examples/2016-10-31/api_backend/template.yaml

Steps to reproduce the issue:
1.execute "sam validate" on serverless-application-model/examples/2016-10-31/api_backend/template.yaml

Observed result:
sam template fails validation with following:

Error: [InvalidResourceException('GetFunction', "Policy at index 0 in the 'Policies' property is not valid"), InvalidResourceException('PutFunction', "Policy at index 0 in the 'Policies' property is not valid"), InvalidResourceException('DeleteFunction', "Policy at index 0 in the 'Policies' property is not valid")] ('DeleteFunction', "Policy at index 0 in the 'Policies' property is not valid") ('GetFunction', "Policy at index 0 in the 'Policies' property is not valid") ('PutFunction', "Policy at index 0 in the 'Policies' property is not valid")

Expected result:
sam template succeeds validation

good first issue

Most helpful comment

The indentation is not correct. if you add one more tab at TableName
e.g.

Policies:
  - DynamoDBReadPolicy:
      TableName: !Ref Table

Then the validation will pass through

All 2 comments

additionally the package.json is missing, which may/or may not confuse some novice users.

It may be useful to include a README.md similiar to the api_cognito_auth example.

The indentation is not correct. if you add one more tab at TableName
e.g.

Policies:
  - DynamoDBReadPolicy:
      TableName: !Ref Table

Then the validation will pass through

Was this page helpful?
0 / 5 - 0 ratings