Big news! The Qovery Terraform Provider is now publicly available for everyone! This article will show you what you can do and why you should consider using Terraform with Qovery.
First published on . We announced the provider in February 2022 with 0.x examples that no longer validate. The examples below were rewritten and validated for the 1.x provider (1.6.2 in November 2026), which also works with OpenTofu. DigitalOcean is no longer supported, and GCP and Azure now are.
What is Terraform
Terraform is an infrastructure as code tool created by HashiCorp. Thousands of products publish Terraform plugins (called providers) so you can manage them in code: you describe the configuration you want in files, and Terraform works out what to create, change or delete. Since August 2023 Terraform is under the Business Source License, and OpenTofu is the MPL-2.0 fork that reads the same code. The Qovery provider is maintained by the Qovery team and published on both the Terraform Registry and the OpenTofu Registry, so everything below runs with terraform or tofu. Contributions are welcome.
Why should you use Terraform in the context of Qovery?
To keep your Qovery clusters, environments, applications and databases in code: reviewed in pull requests, versioned, and reproducible, next to the rest of your infrastructure.
Qovery Terraform Provider features
Declare the provider
HCL
terraform {
required_providers {
qovery = {
source = "qovery/qovery"
version = "~> 1.0"
}
}
}
# Reads the API token from the QOVERY_API_TOKEN environment variable.
provider "qovery" {}
variable "organization_id" {
type = string
}
variable "aws_role_arn" {
type = string
}
The provider reads your API token from the QOVERY_API_TOKEN environment variable, so it never needs to appear in a .tf file.
Create a Kubernetes cluster
AWS EKS cluster
Qovery assumes an IAM role in your AWS account (the AWS installation guide creates it), then creates the VPC, the EKS cluster and its add-ons, and keeps them upgraded. Node capacity is managed by Karpenter.
GCP (GKE Autopilot) and Azure (AKS) are supported today, with cloud_provider = "GCP" and "AZURE". You can also deploy to a Kubernetes cluster you already run. The qovery_cluster reference has an example for each. DigitalOcean, shown in the 2022 version of this post, is no longer supported.
Agents ship fast. Guardrails keep them safe.
Qovery ensures every agent action is scoped, audited, and policy-checked. Start deploying in under 10 minutes.
A project, a production environment on the cluster above, and an application built from a git repository:
HCL
resource "qovery_project" "my_project" {
organization_id = var.organization_id
name = "my-project"
}
resource "qovery_environment" "production" {
project_id = qovery_project.my_project.id
cluster_id = qovery_cluster.my_cluster.id
name = "production"
mode = "PRODUCTION"
}
resource "qovery_application" "backend" {
environment_id = qovery_environment.production.id
name = "backend"
# Public or private repository. For a monorepo, set root_path.
git_repository = {
url = "https://github.com/my-org/my-app.git"
branch = "main"
}
dockerfile_path = "Dockerfile"
cpu = 500 # millicores
memory = 1024 # MB
min_running_instances = 1
max_running_instances = 3
# Qovery gives the app a domain and a TLS certificate.
ports = [
{
internal_port = 8080
external_port = 443
publicly_accessible = true
}
]
healthchecks = {
readiness_probe = {
type = {
tcp = {
port = 8080
}
}
initial_delay_seconds = 30
period_seconds = 10
timeout_seconds = 5
success_threshold = 1
failure_threshold = 3
}
}
}
Qovery provides many more application settings: custom domains, autoscaling, persistent storage, secrets from an external secret manager. The qovery_application reference lists them all.
Second application within the same environment
To add another application to the same environment, declare another qovery_application with a different resource name and name, and the same environment_id.
Deploy a Postgres database
A CONTAINER database runs on the cluster. For a managed database such as Amazon RDS, Qovery recommends a qovery_blueprint resource instead.
HCL
resource "qovery_database" "postgres" {
environment_id = qovery_environment.production.id
name = "postgres"
type = "POSTGRESQL"
version = "17"
mode = "CONTAINER"
accessibility = "PRIVATE"
storage = 20 # GB
}
Deploy a Redis database
HCL
resource "qovery_database" "redis" {
environment_id = qovery_environment.production.id
name = "redis"
type = "REDIS"
version = "7"
mode = "CONTAINER"
accessibility = "PRIVATE"
}
Then run terraform init and terraform apply (or tofu init and tofu apply). Destroying a qovery_deployment deletes its environment and all its services.
How to connect to a service not managed by Qovery?
Your services run in your own cloud account, so they can reach anything else in it. On AWS you can add routes to a peered VPC or a VPN with the routing_table attribute of qovery_cluster, and read secrets from AWS Secrets Manager or Parameter Store.
What else
Check out the provider documentation for every resource, including Helm charts, jobs, Terraform services and deployment stages. Already set up in the Console? The Terraform exporter generates the HCL for an existing environment. The provider uses the Qovery API and its Go client, and the source is on GitHub.
Romaric founded Qovery to make Kubernetes accessible to every engineering team. He writes about platform strategy, developer experience, and the future of cloud infrastructure.
Next step
Agents ship fast. Guardrails keep them safe.
Qovery ensures every agent action is scoped, audited, and policy-checked. Start deploying in under 10 minutes.