e7a9226ea3
* Adding auto sync support * Updated delete and push to support login * Fixes based on feedback. |
||
---|---|---|
.vscode | ||
bin | ||
images | ||
src | ||
.gitignore | ||
CHANGELOG.md | ||
LICENSE | ||
README.md | ||
package-lock.json | ||
package.json | ||
tsconfig.json | ||
tslint.json |
README.md
vscode-terraform-azure README
The VSCode Terraform Azure extension is designed to increase developer productivity building Terraform modules for Azure. The extension provides, linting, terraform command support, resource graph visualization, testing and cloudshell integration inside of VSCode.
Features
The features in this extension support execution in integrated terminal mode or remotely using Azure CloudShell and Azure Container Instance. Some features only run locally at this time and will require some local dependencies.
This extension supports the following features:
- Terraform commands: init, plan, apply, validate, refresh, destroy
- Visualize the terraform module
- Run linting and end to end tests.
Terraform Azure: init
Executes terraform init
command against the current project workspace. If run with terminal set to cloudshell, will run terraform init
in cloudshell.
Terraform Azure: plan
Executes terraform plan
command against the current project workspace. If run with terminal set to cloudshell, will run terraform plan
in cloudshell.
Terraform Azure: apply
Executes terraform apply
command against the current directory. If run with terminal set to cloudshell, will run terraform apply
in cloudshell.
Terraform Azure: validate
Executes terraform validate
command against the current directory. If run with terminal set to cloudshell, will run terraform apply
in cloudshell.
Terraform Azure: refresh
Terraform Azure: destroy
Terraform Azure: visualize
-
NOTE: only runs locally.
Creates a visual representation of the components of the module and save it in graph.png
. This command requires GraphViz dot to be installed locally.
Terraform Azure: execute test
Runs one of the following test against the current module using a test container :
- lint: This command checks the formating of the code of the Terraform module.
- e2e no ssh: This command will deploy the current module with the settings specified in the .tfvars file, verify that the deployment pass the controls and destroy the resources that have been created.
You can run the test locally or in Azure.
-
Running the test locally requires to have Docker installed and create a Service Principal that will be used to authenticate against Azure.
-
Running the test in Azure will create an Azure Container Group in your subscription, it will use the name and resource group defined in the settings files.
Use the following command to get the results of the test (Replace with your own values).
az container logs -n terraformtesting -g TerraformTestRG
In both cases the default test container is "microsoft/terraform-test" and it can be customized through the settings.
-
NOTE: Running the tests in Azure will count against your Azure consumption.
Terraform Azure: push
This command will sync workspace files that meet the filter tf-azure.files
setting in your configuration to Azure clouddrive.
Requirements
This extension requires:
-
Docker if you are running the execute test feature locally.
-
GraphViz dot if you are using the visualize feature.
-
NOTE: On Windows after installing the graphViz msi/zip, you will most likely need to add your PATH env variable
(Ex. c:\Program Files(x86)\GraphViz2.38\bin)
in order to use dot from the command line.
Supported Environments
Extension Settings
tf-azure
- Parent for Terraform-Azure related extension settingstf-azure.terminal
- Specifies terminal used to run Terraform commands. Valid settings arecloudshell
orintegrated
tf-azure.files
- Indicates the files that should be synchronized to Azure cloudshell using the glob pattern string, for example**/*.{tf,txt,yml,tfvars,rb}
tf-azure.test-container
- Indicates the container to use to run the tests, for examplemicrosoft/terraform-test
. Private registry is not supported at this time.tf-azure.aci-name
- Indicates the name of the Azure Container Instance to use for testing. For example:terraformtesting
tf-azure.aci-ResGroup
- Indicates the name of the Resource Group to use for the ACI instance. For example:TerrafornTestRG
tf-azure.aci-group
- Indicates the name of the Container Group that host the ACI instance. For example:TerrafornTesting
tf-azure.test-location
- Indicates the location where to deploy the test container instance. For example:westus
Known Issues
- Windows support for dot has some unhandled exception cases. We are working to improve this area.
- We do not support private registry. The test container has to be on docker hub at this time.
Release Notes
1.0.0
Initial release of vscode-terraform-azure extension.
Working with Markdown
Note: You can author your README using Visual Studio Code. Here are some useful editor keyboard shortcuts:
- Split the editor (
Cmd+\
on OSX orCtrl+\
on Windows and Linux) - Toggle preview (
Shift+CMD+V
on OSX orShift+Ctrl+V
on Windows and Linux) - Press
Ctrl+Space
(Windows, Linux) orCmd+Space
(OSX) to see a list of Markdown snippets
For more information
Enjoy!