Autocomplete your CloudFormation Resources in VS Code
Tags: cloudformation, vscode, aws
Published: 2021-12-03 23:16:57

---
title: Autocomplete your CloudFormation Resources in VS Code
published: true
date: 2020-12-29 07:56:36 UTC
tags: cloudformation, vscode, aws
canonical_url: https://towardsthecloud.com/autocomplete-cloudformation-resources-vscode
---

 **If you use AWS CloudFormation to provision your infrastructure, it can be time-consuming to constantly visit the AWS documentation in order to find the right property of each resource type.** To solve this problem, I created a VS Code extension that adds autocompletion for [every available AWS resource type](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-template-resource-type-ref.html) in a CloudFormation template.

The VS Code extension is called [CloudFormation Snippets](https://marketplace.visualstudio.com/items?itemName=dsteenman.cloudformation-yaml-snippets)

[![AWS CloudFormation Snippets VS Code Marketplace extension](https://cdn.hashnode.com/res/hashnode/image/upload/v1609169841104/D0jbNT27a.jpeg)](https://marketplace.visualstudio.com/items?itemName=dsteenman.cloudformation-yaml-snippets)

## Features

**The VS Code extension contains the following features:**

1. Autocompletion for every AWS CloudFormation resource type (including properties).
2. Support for Intrinsic functions & Conditions.
3. Contains a whole bunch of Parameter types.
4. Use `Tab` to quickly update the property of an AWS CloudFormation resource type.
5. The description of every resource type contains a reference to the official documentation.
6. Github actions will automatically trigger the pipeline and fetch the latest updates from the official [AWS CloudFormation resource specification](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/cfn-resource-specification.html).

## Usage

Here is a small demo that shows what happens when you're trying to add a new CloudFormation resource with the VS Code extension enabled:

[![AWS CloudFormation Snippets example in VS Code](https://cdn.hashnode.com/res/hashnode/image/upload/v1621279480724/hPWOwLePc.gif)](https://marketplace.visualstudio.com/items?itemName=dsteenman.cloudformation-yaml-snippets)

**Steps described in further detail:**

- Step 1. Install the [extension](https://marketplace.visualstudio.com/items?itemName=dsteenman.cloudformation-yaml-snippets) in your VS Code editor
- Step 2. Create a template file in `.yml` format to start working on AWS CloudFormation
- Step 3. Make sure that the file type is listed as `YAML` in the VS Code editor (Bottom right-hand corner).
- Step 4. Type `cfn` to get the AWS CloudFormation template fragment.
- Step 5. Start adding resources in the resource section of the template by using the prefix name e.g. `autoscaling-autoscalinggroup` equals resource type `AWS::AutoScaling::AutoScalingGroup`

> **Note:** If the autocomplete doesn't get invoked automatically in step 5. Then you can invoke IntelliSense manually by pressing `ctrl + space`. Search for the prefix of the resource type that you want to add and press `Enter`.

### More helpful VS Code extensions for AWS CloudFormation

If you're looking to optimize your VS Code with more useful extensions, then have a look at the other article I wrote to help you level up your CloudFormation templating game!

[https://towardsthecloud.com/level-up-cloudformation-with-vs-code](https://towardsthecloud.com/level-up-cloudformation-with-vs-code)

### Also have a look at a VS Code extension I made for AWS CDK

If you're working with AWS CDK, then you might be interested in my other VS Code extension that I created which adds L1 construct snippets from AWS CDK into VS Code.

[https://towardsthecloud.com/autocomplete-aws-cdk-l1-constructs-vs-code](https://towardsthecloud.com/autocomplete-aws-cdk-l1-constructs-vs-code)

* * *

👋 **Enjoyed this article?** Reach out in the comments below or on [Twitter](https://twitter.com/dannysteenman) to let me know what you think of it.

If you found some **value** in reading this, please consider showing your support by [sponsoring me](https://towardsthecloud.com/sponsor). Thanks to your support, I'm able to continue doing what I enjoy the most, which is sharing my learnings with the Cloud Community.