Files
landing_page/qdrant-landing/content/documentation/cloud-tools/terraform.md
T
1a40961d62 fix: linkchecker include filter port mismatch (#2242)
* initial commit; fixed anchor links on internal docs pages

* add back in absolute paths for links in code comments

* fix: update linkchecker include filter to match server port 1314

PR #1629 changed the Hugo server to port 1314 but forgot to update
the --include filter, which still matched port 1313. This caused all
links to be excluded, making the checker a no-op (0 checked, 82277 excluded).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* Fix url rewrite regex so images are not impacted

* Fix links from non-documentation pages

* Fix broken links

* more broken links

* more broken links

* broken link

* Add srcset width descriptor to .lycheeignore

* Ignore URLs that contain a % character

* Anchor regex so it matches the entire URL

---------

Co-authored-by: kanungle <neil.kanungo@gmail.com>
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-authored-by: Abdon Pijpelink <abdon.pijpelink@qdrant.com>
2026-03-30 17:21:32 +02:00

3.7 KiB

title, aliases
title aliases
Terraform
/documentation/infrastructure/terraform/

Terraform Logo

HashiCorp Terraform is an infrastructure as code tool that lets you define both cloud and on-prem resources in human-readable configuration files that you can version, reuse, and share. You can then use a consistent workflow to provision and manage all of your infrastructure throughout its lifecycle.

With the Qdrant Terraform Provider, you can manage the Qdrant cloud lifecycle leveraging all the goodness of Terraform.

Pre-requisites

To use the Qdrant Terraform Provider, you'll need:

  1. A Terraform installation.
  2. An API key to access the Qdrant cloud API.

Example Usage

The following example creates a new Qdrant cluster in Amazon Web Services (AWS) and returns the URL of the cluster.

// see: https://registry.terraform.io/providers/qdrant/qdrant-cloud/latest/docs/guides/getting-started
// Setup Terraform, including the qdrant-cloud providers
terraform {
  required_version = ">= 1.7.0"
  required_providers {
    qdrant-cloud = {
      source  = "qdrant/qdrant-cloud"
      version = ">=1.1.0"
    }
  }
}

// Add the provider to specify some provider wide settings
provider "qdrant-cloud" {
  api_key    = "<QDRANT_CLOUD_MANAGEMENT_KEY>"  // API Key generated in Qdrant Cloud (required)
  account_id = "<QDRANT_CLOUD_ACCOUNT_ID>"      // The default account ID you want to use in Qdrant Cloud (can be overriden on resource level)
}

// Get the cluster package
// see https://registry.terraform.io/providers/qdrant/qdrant-cloud/latest/docs/guides/getting-started#available-cloud-providers-and-regions
data "qdrant-cloud_booking_packages" "all_packages" {
  cloud_provider = "aws"
  cloud_region   = "us-west-2"
}

locals {
  desired_package = [
    for pkg in data.qdrant-cloud_booking_packages.all_packages.packages : pkg
    if pkg.resource_configuration[0].cpu == "500m" && pkg.resource_configuration[0].ram == "2Gi"
  ]
}

// Create a cluster (for the sake of having an ID, see below)
resource "qdrant-cloud_accounts_cluster" "example" {
  name           = "tf-example-cluster"
  cloud_provider = data.qdrant-cloud_booking_packages.all_packages.cloud_provider
  cloud_region   = data.qdrant-cloud_booking_packages.all_packages.cloud_region
  configuration {
    number_of_nodes = 1
    database_configuration {
      service {
        jwt_rbac = true
      }
    }
    node_configuration {
      package_id = local.desired_package[0].id
    }
  }
}

// Create an V2 Database Key, which refers to the cluster provided above
resource "qdrant-cloud_accounts_database_api_key_v2" "example" {
  cluster_id   = qdrant-cloud_accounts_cluster.example.id
  name         = "example-key"
}

// Output some of the cluster info
output "cluster_id" {
  value = qdrant-cloud_accounts_cluster.example.id
}

output "cluster_version" {
  value = qdrant-cloud_accounts_cluster.example.version
}

output "url" {
  value = qdrant-cloud_accounts_cluster.example.url
}

// Output the Database API Key (which can be used to access the database cluster)
output "key" {
  value       = qdrant-cloud_accounts_database_api_key_v2.example.key
  description = "Key is available only once, after creation."
}

Further Reading

The provider documentation contains more details on the available resources and data sources, including additional examples: