/terrastate

Visual Studio Code extension to monitor/deploy/destroy Terraform resources in workspace

Primary LanguageTypeScriptMIT LicenseMIT

Terrastate

Monitor the state of your Terraform resources


Terrastate is a Visual Studio Code extension that can be used to monitor, deploy and destroy Terraform resources. You can find the extension here.


Release: 1.0.0

Highlighted Features

  • Minimalist UI/UX to show the state of Terraform resources
  • Supports Terraform commands on single click
  • Shows directory level Terraform graph

Quick start

Step 1. Install the Terrastate extension for Visual Studio Code
Step 2. Click on the Terrastate icon in the side panel
Step 3. The terraform resources defined in the workspace will be listed in the right-side tree view

Supported Commands

To view the list of commands, left-click on the directory/resource in the Terrastate View.

Directory Level

Command Description
Apply All Runs terraform apply on directory level
Destory All Runs terraform destroy on directory level
Initialize Runs terraform init on the directory
Refresh Runs terraform refresh on the directory
Validate Runs terraform validate on the directory

Resource Level

Command Description
Apply Runs terraform apply targeted on the resource
Destory Runs terraform destroy targeted on the resource
Taint Runs terraform taint targeted on the resource
Untaint Runs terraform untaint targeted on the resource

Issues, feature requests, and contributions

Issues

  • If you come across a problem with the extension, please file an issue
  • For list of known issues, please check the issues tab

Feature requests

  • Find planned features for future releases marked as feature under issues tab.
  • For new feature requests, please file an issue

Contributions

Contributions are always welcome!

Running the extension locally for development

  1. Clone the repository and install dependencies by running yarn install
  2. Press F5 to open a new window with your extension loaded.
  3. Run your command from the command palette by pressing (Ctrl+Shift+P or Cmd+Shift+P on Mac) and typing Terrastate: Focus on Terrastate View. Alternatively, you can also find the Terrastate icon on the side panel.

Folder structure

  • package.json: this is the manifest file in which you declare your extension and command.
  • src/extension.ts: this is the main file where you will provide the implementation of your command. The file exports one function, activate, inside which we call registerCommand. We pass the function containing the implementation of the command as the second parameter to registerCommand.
  • src/terraform.ts: this is the file containing function definitions pertaining to Terraform.
  • src/terraformProvider.ts and src/graphProvider.ts: these are the files where you will define the Terrastate and Graph tree views respectively.

Making changes

  • You can relaunch the extension from the debug toolbar after changing code in src.
  • You can also reload (Ctrl+R or Cmd+R on Mac) the VS Code window with your extension to load your changes.

Related