The AWS team has released the JSON Schema for SAM templates. It had a bug initially but now it’s working flawlessly.
The official schema will help you write SAM templates faster, without checking the AWS docs every time you need to use a new property.
Here’s how to use it in VS Code:
- Make sure the YAML extension is installed.
- Add the following line to the top of your YAML template file:
# yaml-language-server: $schema=https://raw.githubusercontent.com/aws/serverless-application-model/main/samtranslator/schema/schema.json
And it’s done! Now you will get suggestions from VS Code: