Skip to main content

Set up a development environment

Prepare the tools and access needed to write, validate, and test Compliance Engine v2 policies.

Before you begin​

  • Obtain access to your organization's policy repository. See Access the policy repository.
  • Identify the Cloudaware organization you will use for development and obtain the credentials needed for CLI authentication.
  • If you will query inventory or evaluation results, obtain the BigQuery export project ID, dataset names, and query access.

Repository access, Cloudaware CLI authentication, and Google Cloud permissions are configured separately. A working Git connection does not establish access to either Cloudaware APIs or BigQuery.

Cloudaware recommends using Visual Studio Code. This repository is pre-configured to support VS Code with a rich set of extensions and a ready-to-use development container.

There are two equally preferred ways to use VS Code:

  • Local VS Code: Use your local installation of VS Code and install the recommended extensions.
  • Dev Container: Use the provided dev container, which comes with all the necessary tools and extensions pre-installed.

Both options support the same authoring workflow.

Local VS Code Setup​

  1. Install VS Code, Git, Java, the Google Cloud CLI, and repo-manager as described below.
  2. Open your local policy repository in VS Code.
  3. Install the recommended extensions:
PurposeExtensions
YAML validation and completionYAML
Markdown editingMarkdown All in One, markdownlint
BigQuery queriesSQL (BigQuery), BigQuery Runner
Editing utilitiesCode Spell Checker, Path Autocomplete

The repository configures YAML schema mappings for validation and completion. Use Ctrl+Space when editing YAML to view suggestions.

Dev Container Setup​

A devcontainer runs the development tools in a Docker container with the repository workspace mounted inside it. The repository includes a pre-configured devcontainer.json.

There are several ways to run a devcontainer:

  • GitHub Codespaces which is a service that provides cloud-based development environments.
    • To explore the Compliance Engine development environment without committing any changes, you can create a GitHub codespace directly from our public repository.
    • If you already have a private repository, you can create a GitHub codespace from it to get a fully functional development environment.
  • Local Devcontainers. Using Devpod for running devcontainers locally. Follow the installation instructions, and then create a workspace from your local repository or directly from a Git repository.
note

For Windows users: We do not recommend using Docker Desktop for Windows due to its poor disk I/O performance with workspaces located on the Windows filesystem. Instead, we recommend installing docker and the devpod CLI directly into WSL2 and using workspaces located within the WSL filesystem. See Performance across OS file systems.

Other IDEs​

You can use other IDEs such as IntelliJ IDEA, WebStorm, or any other editor of your choice. However, Cloudaware does not provide pre-configured setups or specific instructions for them.

CLI-Only Setup​

If you prefer to work from the command line, you can use the following tools:

  • Git: For version control.
  • Java: Required to run repo-manager.jar.
  • repo-manager: To manage the repository.
  • Google Cloud CLI: For interacting with Google Cloud services, particularly BigQuery.

Install and configure repo-manager​

For a local installation, follow the repo-manager installation guide. The tool requires Java 17 or later; the latest Java LTS release is recommended. The dev container already supplies a repo-manager alias.

In your development terminal, check that the command is available:

repo-manager --version
repo-manager --help

The first command prints the installed version; the second lists commands and options. If you have downloaded the JAR without configuring an alias, run it with java -jar and the path to repo-manager.jar.

Configure authentication and profiles​

repo-manager uses authorization profiles to connect to Cloudaware. Its auth add command accepts a profile name and an OAuth token obtained from the Cloudaware Admin tab. Follow the authentication command reference to add a profile for your organization.

List configured profiles and select the one to use:

repo-manager auth list
repo-manager auth activate --name YOUR_PROFILE

Replace YOUR_PROFILE with your profile name. Profiles are stored in profiles.json; see repo-manager configuration files for configuration locations and lookup order.

When using a container or codespace, configure the profile there rather than assuming your host's configuration is available.

Prepare BigQuery permissions​

For queries against your organization's export data, arrange BigQuery Data Viewer and BigQuery Job User access with your Google Cloud administrator. Follow Configure BigQuery permissions for Compliance Engine.

Use the Google account granted access when configuring your BigQuery query tool. Cloudaware authorization profiles do not grant Google Cloud IAM permissions.

Update schemas and verify the environment​

From the policy repository root, update the YAML schemas and inspect the CLI environment:

repo-manager schema update
repo-manager env

The schema command refreshes repository schema files. The environment command displays the current environment information. See the CLI reference for both commands.

Before authoring a policy, confirm that:

  • repo-manager runs in your chosen terminal and the intended authorization profile is active.
  • VS Code provides YAML validation and completion when you open a policy file.
  • Your BigQuery query tool can access the intended project and datasets if your task requires live data.

Continue with Structure a custom policy, then Test and debug policies.