2 Answers
- Newest
- Most votes
- Most comments
0
Try validating your template.yaml using the AWS SAM CLI: sam validate This can catch syntax issues.
Validating templates: https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/serverless-sam-cli-using-validate.html
answered 6 months ago
0
Hi, I think you might need to clarify your question. You started off saying the error is "Unresolved tag: !RefYAML" but then later that it's "E0001 Error transforming template: Resource with id [CounterFunction] is invalid. Policy at index 0 in the 'Policies' property is not valid" - do you have both?
You will need to provide the relevant part of your template with proper "code" formatting as white space is so important with YAML. You can do this if you post an Answer rather than a Comment here.
Relevant content
- asked 3 years ago
- Accepted Answerasked 10 months ago
- AWS OFFICIALUpdated 3 years ago
- AWS OFFICIALUpdated a year ago
- AWS OFFICIALUpdated 9 months ago
- AWS OFFICIALUpdated 3 years ago
Dave- thank you for responding. Yes, when I entered the command "sam validate --template template.yaml", I got the same error that I had in the past, namely "E0001 Error transforming template: Resource with id [CounterFunction] is invalid. Policy at index 0 in the 'Policies' property is not valid". This is specifically referring to a policy: Policies: - DynamoDBCrudPolicy: TableName: !Ref CounterTable So, it shows the same error I expected. How should I fix the !Ref error?
Apologies for the formatting. Those lines are in my template.yaml file, with "Policies:" on one line, "- DynamoDBCrudPolicy:" on the next, and "TableName: !Ref CounterTable" on the next.