Skip to content

PruneOps Terraform provider

Manage your PruneOps organization as code: connect cloud accounts, decide what is inventoried and tracked, and point PruneOps at your Terraform states — reviewed in pull requests like the rest of your infrastructure.

terraform {
  required_providers {
    pruneops = {
      source = "registry.pruneops.run/pruneops/pruneops"
    }
  }
}

provider "pruneops" {} # token in PRUNEOPS_API_TOKEN

resource "pruneops_cloud_account" "aws_prod" {
  name        = "AWS production"
  provider_id = "aws"
  regions     = ["eu-west-1"]

  credentials_wo = {
    access_key_id     = var.aws_access_key_id
    secret_access_key = var.aws_secret_access_key
  }
  credentials_wo_version = 1
}
pruneops_cloud_account A cloud account (AWS, OVH, Hetzner, DigitalOcean, Cloudflare…) and its credentials
pruneops_cloud_account_resource_policy What an account inventories and tracks
pruneops_terraform_config Where PruneOps reads your .tfstate files
pruneops_providers The provider catalog: ids, regions, credential fields
pruneops_cloud_accounts Every account of the organization

Credentials are write-only: they never reach the Terraform state. Start with the getting started guide.