> ## Documentation Index
> Fetch the complete documentation index at: https://docs.rafftechnologies.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Install the Raff Terraform Provider

> Install the provider from the Terraform Registry, build from source for local development, or pin a specific version. Works with Terraform 1.0+ and OpenTofu.

<sub>Updated May 10, 2026</sub>

The Raff Terraform Provider is published on the Terraform Registry. For most users, declaring it in your `required_providers` block is the only "install" step needed — Terraform downloads it on first `terraform init`.

<Card title="View on Terraform Registry" icon="hashicorp" href="https://registry.terraform.io/providers/RaffTechnologies/raff/latest">
  registry.terraform.io/providers/RaffTechnologies/raff/latest — auto-generated schema docs for every resource and data source, plus version history.
</Card>

## Standard install (Terraform Registry)

In any new or existing Terraform module:

```hcl theme={null}
terraform {
  required_providers {
    raff = {
      source  = "RaffTechnologies/raff"
      version = "~> 0.1"
    }
  }
}

provider "raff" {
  api_key = var.raff_api_key
}
```

Then:

```bash theme={null}
terraform init
```

Terraform fetches the provider from the registry and pins it in `.terraform.lock.hcl`. Re-run `terraform init -upgrade` to pull a newer version that satisfies the version constraint.

The same workflow works with OpenTofu (`tofu init`).

## Version constraints

| Constraint                  | What it allows                                               |
| --------------------------- | ------------------------------------------------------------ |
| `version = "0.1.0"`         | Exactly 0.1.0                                                |
| `version = "~> 0.1"`        | Any 0.1.x — recommended for most teams                       |
| `version = "~> 0.1, < 0.5"` | Any 0.1.x up to but not including 0.5.0                      |
| `version = ">= 0.1"`        | Any version ≥ 0.1 — use only when you actively track changes |

Lock-files (`.terraform.lock.hcl`) record the exact version `terraform init` resolved, so collaborators on the same module use the same provider build. Commit the lock file.

## Build from source (local development)

Useful when you're contributing to the provider, testing a pre-release fix, or need to debug locally:

```bash theme={null}
# Clone
git clone https://github.com/RaffTechnologies/terraform-provider-raff.git
cd terraform-provider-raff

# Build
go build -o terraform-provider-raff

# Install to local Terraform plugin path
mkdir -p ~/.terraform.d/plugins/registry.terraform.io/RaffTechnologies/raff/0.1.0/$(go env GOOS)_$(go env GOARCH)
cp terraform-provider-raff ~/.terraform.d/plugins/registry.terraform.io/RaffTechnologies/raff/0.1.0/$(go env GOOS)_$(go env GOARCH)/
```

Now any Terraform module that requires `RaffTechnologies/raff` 0.1.0 will use your local build instead of the registry version.

To switch back to the registry version, delete the local plugin file and re-run `terraform init -upgrade`.

## Verify

```bash theme={null}
terraform providers
```

Should list `RaffTechnologies/raff` with the resolved version.

```bash theme={null}
terraform plan
```

Against an empty state, this should connect to the API (using the configured key) and report `No changes`.

## Authentication

The provider needs an API key. Two ways to provide it:

```hcl theme={null}
# Block argument
provider "raff" {
  api_key = var.raff_api_key
}
```

Or, more commonly:

```bash theme={null}
# Environment variable — keeps the key out of .tf files
export RAFF_API_KEY="raff_<your-key>"
```

Block arguments take precedence over env vars when both are set. See [Generate an API key](/products/manage/team-projects/quickstart-guides/generate-api-key) for issuing a scoped key, and [Roles, scopes, and the Owner](/products/manage/team-projects/concepts/roles-and-api-keys) for picking the right role to assign.

## Next steps

<CardGroup cols={3}>
  <Card title="raff_project" icon="folder" href="/reference/terraform/raff_project">
    The project resource.
  </Card>

  <Card title="raff_vm" icon="server" href="/reference/terraform/raff_vm">
    The VM resource.
  </Card>

  <Card title="Provider intro" icon="map" href="/reference/terraform/introduction">
    Quick start and what the provider covers.
  </Card>
</CardGroup>
