I created an extension for AWS CDK that adds all available L1 constructs from AWS CDK into Visual Studio Code in the form of snippets. Basically, it will autocomplete any CloudFormation resource you specify including its properties + values.
The VS Code extension is called CDK Construct Snippets
For now, the VS Code extension only supports TypeScript. But if you want to help out and make it available for more programming languages, then you can help by contributing in the GitHub repository
The VS Code extension contains the following features:
- Supports all resources that are defined by CloudFormation in the form of L1 constructs in AWS CDK
- Triggers autocomplete by invoking
- The construct snippets are automatically updated every week after AWS updates their CloudFormation Resource Specification.
- Has built-in support for placeholders. This means you can quickly jump from property to property in each resource by using
- The extension will show which property is required by adding a
// requiredcomment next to it.
- The autocomplete prompt shows the matching AWS CDK resource documentation URL in its description.
- Step 1. Install this extension
- Step 2. Start working in your AWS CDK project (TypeScript)
Step 3. Start adding L1 constructs in your code by using their prefix name e.g.
l1-s3-bucketequals to L1 construct
Note: Once you start typing a prefix (explained in step 3), the corresponding snippet shows up in the dropdown menu. If this doesn't happen automatically, press
ctrl + spaceto invoke IntelliSense and search for the prefix of the resource type that you want to add (as listed in step 3).
If you're working with AWS CloudFormation, then you might be interested in my other VS Code extension that I created which adds autocomplete snippets for all the AWS CloudFormation resources for YAML templates.
👋 Enjoyed this article? Reach out in the comments below or on Twitter to let me know what you think of it.