Skip to content

run-at-scale/vscode-terraform-doc-snippets

Repository files navigation

vscode-terraform-doc-snippets

Version Install Ratings

Terraform

A vscode extension that yanks resource and data source documentation from Terraform provider repos and transforms them into structured VS Code snippets. Over 9000 snippets included.

Demo

Demo

Motivation

The existing Terraform snippet extensions offer a set of user-defined snippets. Some of them are good but many lack the context to really be useful and only about 1/3 of the resources and data sources in the public providers are covered. Terraform documentation is largely good and continues to evolve alongside the providers so it makes sense to build a snippet extension that pulls snippets directly from documentation code examples. This makes for a scalable way to continuously provide up to date resource and data source snippets. The examples in documentation often give excellent context which is important for understanding how infrastructure primitives fit together.

Getting started

The following commands are used to build the snippets file:

nvm use lts/dubnium
npm install ---dev
npm run build:snippets

Features

  • All resources and data source snippets gathered from documentation. As docs improve, so do the snippets.
  • All snippets are delivered as a pre-compiled bundle - no dynamic lookups so your editor stays speedy.
  • Resource and data source name collisions avoided by including data or resource in each snippet prefix.
  • All providers listed in the terraform-providers organization are covered.
  • Ability to override or add additional snippets through configuration.

Known Issues

  • Issue #1 is probably that this is my first node project and I'm not to be trusted with the language. Help and review wanted! Tests needed.

Contributing

Report issues/questions/feature requests on in the issues section.

Full contributing guidelines are covered here.

Changelog

The changelog captures all important release notes.

Authors

Created and maintained by Brandon Bjelland - brandon@atscale.run.

License

MIT Licensed. See LICENSE for full details.