Terrastate is a Visual Studio Code extension that can be used to monitor, deploy and destroy Terraform resources. You can find the extension here.
- Minimalist UI/UX to show the state of Terraform resources
- Supports Terraform commands on single click
- Shows directory level Terraform graph
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
To view the list of commands, left-click on the directory/resource in the Terrastate View.
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 |
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 |
- If you come across a problem with the extension, please file an issue
- For list of known issues, please check the issues tab
- Find planned features for future releases marked as feature under issues tab.
- For new feature requests, please file an issue
Contributions are always welcome!
- Clone the repository and install dependencies by running
yarn install
- Press
F5
to open a new window with your extension loaded. - Run your command from the command palette by pressing (
Ctrl+Shift+P
orCmd+Shift+P
on Mac) and typingTerrastate: Focus on Terrastate View
. Alternatively, you can also find the Terrastate icon on the side panel.
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 callregisterCommand
. We pass the function containing the implementation of the command as the second parameter toregisterCommand
.src/terraform.ts
: this is the file containing function definitions pertaining to Terraform.src/terraformProvider.ts
andsrc/graphProvider.ts
: these are the files where you will define the Terrastate and Graph tree views respectively.
- You can relaunch the extension from the debug toolbar after changing code in
src
. - You can also reload (
Ctrl+R
orCmd+R
on Mac) the VS Code window with your extension to load your changes.
- Presented at HashiConf Global 2021 – Lightning Talk
- MIT License