The Constellation Terraform provider can be built through Bazel.
Use the all-in-one Target (Recommended):
The [`devbuild` target](./build-develop-deploy.md), will create a `terraform` directory
with the provider binary and some utility files in the dedicated local Terraform registry directory.
```bash
bazel run //:devbuild'
```
> [!IMPORTANT] when making changes on the provider without a commit, subsequent applies will fail due to the changed binary hash. To solve this, in your Terraform directory run:
Make sure to add the build's pseudo-version (without the `v` prefix) as the `<version>`. Alternatively, check the available versions in your local plugin cache:
```bash
ls ~/.terraform.d/plugins/registry.terraform.io/edgelesssys/constellation
Alternatively, you can configure Terraform to use your binary by setting a [development override](https://developer.hashicorp.com/terraform/cli/config/config-file#development-overrides-for-provider-developers),
so that the registry path to the provider is replaced with the path to the locally built provider.
A `config.tfrc` file containing the necessary configuration can be created with the following commands:
The tests can also be run through Go, but the `TF_ACC` environment variable needs to be set to `1`, and the host's Terraform binary is used, which may produce inaccurate test results.