You can run the Accurics CLI inside Microsoft Visual Studio Code (VS Code) either by right-clicking a file or using the quick launcher.
- Microsoft VS Code
- Microsoft VS Code Terraform extension
- Terraform version greater than .14
- For Integrated mode scans:
- An Accurics user account with an Operator or greater role
- An Azure subscription with enough permissions to create a source and network security group
- A project in Accurics Console to scan your IaC repository that you will be using to create the CI/CD builds
Install the Accurics VS Code Extension
You can either install it directly from the Microsoft VS Code Extension Marketplace or go to the Accurics page on the Visual Studio Marketplace website.
Accurics for Visual Studio Code extension supports Terraform, Kustomize, Helm & Kubernetes YAML. The extension uses Accurics Extension operates in two modes:
- Standalone: This mode does not require an Accurics account. IaC scans are performed locally within the Microsoft VS Code environment. Results are displayed in the output window.
- Integrated: Scan results are visible on the Accurics Console. The Accurics Console offers rich capabilities for viewing various KPIs, Policy Violations, and Drifts.
To select a mode:
- In the Microsoft VS Code command palette, type Accurics, and then click Accurics Mode.
- From the list of modes, select the desired mode Standard or Integrated.
Using the Standalone mode
- Launch the Accurics for Visual Studio Code exension and select Mode as Standalone.
- After selecting the, right-click on any IaC file.
- Select Accurics Scan.
- From the list of IaC type, select the the required type.
The available options are: Yaml, Helm, Kustomize, or Terraform.
Accurics for Visual Studio Code extension performs the IaC scan and reports the results in the Microsoft VS Code output window.
Using the Integrated mode
- Launch the Accurics for Visual Studio Code exension and select Mode as Integrated.
- Sign up for an Accurics account.
- Sign in to Accurics Console.
- Create a project. See Connect your cloud provider.
- On the Home page, click the project name in the Project column.
- In the Project details panel, click the Configuration link to download the configuration file.
- Place the configuration file in a local folder of the extension.
- In Visual Studio workspace, run the Accurics Configure command and select the downloaded file.
- In Microsoft VS Code workspace, right-click on any IaC file and click Accurics Scan.
- Select desired option from the displayed scan commands.
- Specify appropriate command options in the prompted input field.
If no command options specified, the command runs without any option.
The extension performs the scan and reports the results in the Microsoft VS Code output window and the Accurics Console.