AWS SAM JSON Schema in VS Code

less than 1 minute read

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:

  1. Make sure the YAML extension is installed.
  2. 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:

VS Code SAM Schema

Tags:

Categories:

Updated: