Blog
Qovery
Terraform
Product
6
minutes

The Qovery Terraform Provider is Available Now

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.
Romaric Philogène
CEO & Co-founder
Summary
Twitter icon
linkedin icon

What is Terraform

Terraform is an open-source infrastructure as code software tool created by HashiCorp. Thousands of products provide Terraform plugins (called providers) to manage them. Basically, you describe in a file how you want to configure your software and how you want to connect them, and Terraform manages everything for you. It is not magic. Thanks to the big Terraform community for providing and maintaining all the Terraform Providers. This is where the Qovery team provides and supports their Terraform Provider officially. Every contribution is appreciated.

Why should you use Terraform in the context of Qovery?

The main reason why using Terraform in the context of Qovery is to keep track of the changes across the configuration of your Qovery clusters, applications, and databases.

Demo

Watch our complete Terraform demo

Qovery Terraform Provider features

Create a Kubernetes cluster

AWS EKS cluster

Here is the Terraform configuration to create a Kubernetes cluster (EKS) on AWS.

terraform {
required_providers {
qovery = {
source = "qovery/qovery"
}
}
}

# Configure the Qovery provider
provider "qovery" {
token = ""
}

variable "organization_id" {
type = string
default = ""
}

resource "qovery_aws_credentials" "my_aws_creds" {
organization_id = var.organization_id
name = "my_aws_creds"
access_key_id = ""
secret_access_key = ""
}

resource "qovery_cluster" "my_cluster" {
organization_id = var.organization_id
credentials_id = qovery_aws_credentials.my_aws_creds.id
name = "test_terraform_provider"
description = "Kubernetes cluster created with Terraform"
cloud_provider = "AWS"
region = "us-east-2"
cpu = 2000 # 2000 mCPU = 2 vCPU
memory = 4096 # 4096 MB = 4GB
min_running_nodes = 3 # min auto scaling nodes
max_running_nodes = 10 # max auto scaling nodes

depends_on = [
qovery_aws_credentials.my_aws_creds
]
}

Note: Qovery supports VPC configuration and static IPs for AWS EKS.

Scaleway Kapsule

Here is the Terraform configuration to create a Kubernetes cluster (Kapsule) on Scaleway.

terraform {
required_providers {
qovery = {
source = "qovery/qovery"
}
}
}

# Configure the Qovery provider
provider "qovery" {
token = ""
}

variable "organization_id" {
type = string
default = ""
}

resource "qovery_scaleway_credentials" "my_scaleway_creds" {
organization_id = var.organization_id
name = "my_scaleway_creds"
scaleway_access_key = ""
scaleway_secret_key = ""
scaleway_project_id = ""
}

resource "qovery_cluster" "my_cluster" {
organization_id = var.organization_id
credentials_id = qovery_scaleway_credentials.my_scaleway_creds.id
name = "test_terraform_provider"
description = "Kubernetes cluster created with Terraform"
cloud_provider = "SCALEWAY"
region = "fr-par-1"
cpu = 2000 # 2000 mCPU = 2 vCPU
memory = 4096 # 4096 MB = 4GB
min_running_nodes = 3 # min auto scaling nodes
max_running_nodes = 10 # max auto scaling nodes

depends_on = [
qovery_scaleway_credentials.my_scaleway_creds
]
}

Digital Ocean Kubernetes

Here is the Terraform configuration to create a Kubernetes cluster on Digital Ocean.

terraform {
required_providers {
qovery = {
source = "qovery/qovery"
}
}
}

# Configure the Qovery provider
provider "qovery" {
token = ""
}

variable "organization_id" {
type = string
default = ""
}

resource "qovery_digitalocean_credentials" "my_digitalocean_creds" {
organization_id = var.organization_id
name = "my_digitalocean_creds"
token = ""
spaces_access_id = ""
spaces_secret_key = ""
}

resource "qovery_cluster" "my_cluster" {
organization_id = var.organization_id
credentials_id = qovery_digitalocean_credentials.my_digitalocean_creds.id
name = "test_terraform_provider"
description = "Kubernetes cluster created with Terraform"
cloud_provider = "DIGITAL_OCEAN"
region = "nyc3"
cpu = 2000 # 2000 mCPU = 2 vCPU
memory = 4096 # 4096 MB = 4GB
min_running_nodes = 3 # min auto scaling nodes
max_running_nodes = 10 # max auto scaling nodes

depends_on = [
qovery_digitalocean_credentials.my_digitalocean_creds
]
}

Google Cloud Platform and Microsoft Azure?

We plan to support GCP and Azure this year. Check out our public roadmap.

Deploy an application

Here is a Terraform file to deploy an application in a Project and production Environment on my Kubernetes cluster via Qovery.

resource "qovery_project" "my_project" {
organization_id = var.organization_id
name = "MyProject"
}

resource "qovery_environment" "my_environment" {
project_id = qovery_project.my_project.id
name = "Production"

depends_on = [
qovery_project.my_project
]
}

resource "qovery_application" "my_backend_app" {
environment_id = qovery_environment.my_environment.id
name = "my backend app 1"
description = "My first app in my prod environment"
cpu = 500 # 500 mCPU = 0.5 vCPU
memory = 1024 # 1024 MB = 1GB
min_running_instances = 1 # min auto scaling app instances
max_running_instances = 3 # max auto scaling app instances
git_repository {
# you can set a private or public repository - Qovery manages it automatically for you
url = "https://github.com/evoxmusic/ShortMe-URL-Shortener"
branch = "main"
root_path = "/" change the root path for mono repositories
}

# Qovery provides a temporary domain and a TLS certificate auto-renew with CertManager
ports = [{
internal_port = 8080
external_port = 443
protocol = "HTTPS"
publicly_accessible = true
}]

depends_on = [
qovery_environment.my_environment
]
}

Qovery provides tons of options to custom your application settings. Check out the app documentation or API to see all the capabilities.

Second application within the same environment

To add a second application (you can add more) within the same environment, it is as simple as adding a "qovery_application" object with a different name.

resource "qovery_application" "my_backend_app_2" {
environment_id = qovery_environment.my_environment.id
name = "my backend app 2"
description = "My first app in my prod environment"
# ... add other params
}

Deploy a Postgres database

Qovery supports the deployment of Postgres in managed mode (with backups) and container mode (without backups). Check out the documentation to understand all the differences.

resource "qovery_database" "my_postgres" {
environment_id = qovery_environment.my_environment.id
name = "MyPostgres"
type = "POSTGRESQL"
version = "13"
mode = "CONTAINER" # and MANAGED
accessibility = "PRIVATE" # you can make your DB publicly accessible with PUBLIC
cpu = 250
memory = 256
storage = 10240 # in MB

depends_on = [
qovery_environment.my_environment
]
}

Deploy a Redis database

Here is another example with Redis

resource "qovery_database" "my_redis" {
environment_id = qovery_environment.my_environment.id
name = "MyRedis"
type = "REDIS"
version = "6"
mode = "CONTAINER" # and MANAGED
accessibility = "PRIVATE" # you can make your DB publicly accessible with PUBLIC
cpu = 250
memory = 256
storage = 10240 # in MB

depends_on = [
qovery_environment.my_environment
]
}

How to connect to a service not managed by Qovery?

Qovery's DevOps automation tool does not limit you. You can still connect to a service not managed by Qovery with VPC peering.

What else

Check out the exhaustive documentation to see all the capabilities. If something is missing, feel free to contribute by opening a Pull Request. Our Terraform provider uses our open API and our Golang SDK.

Wrapping up

Feel free to try out our Qovery Terraform Provider yourself and share your feedback on Discord and our forum.

Share on :
Twitter icon
linkedin icon
Ready to rethink the way you do DevOps?
Qovery is a DevOps automation platform that enables organizations to deliver faster and focus on creating great products.
Book a demo

Suggested articles

DevOps
Kubernetes
Platform Engineering
15
 minutes
Top 10 Openshift Alternatives & Competitors

Because various organizations need cloud application and service management that offers different levels of simplicity, cost-effectiveness, or feature sets than OpenShift, this article will review its top alternatives to help readers make an informed decision aligned with their specific infrastructure needs.

Morgan Perry
Co-founder
AI
Infrastructure Management
Product
5
 minutes
GPU workloads on EKS just got way simpler with Qovery

Running GPU workloads on EKS has never been easy, until now. With Qovery’s latest update, you can enable GPU nodes, configure GPU access, and optimize costs automatically, all without writing a single line of YAML or touching Helm charts. Qovery now handles everything behind the scenes so you can focus entirely on your applications.

Alessandro Carrano
Lead Product Manager
Kubernetes
 minutes
Kubernetes Deployment Strategies: Pros, Cons & Use Cases

Master Kubernetes deployment strategies: Rolling Update, Recreate, Blue/Green, and Canary. Learn the pros, cons, and use cases to choose the right strategy based on your uptime, risk tolerance, and resources. Simplify complex rollouts with automation.

Mélanie Dallé
Senior Marketing Manager
DevOps
Developer Experience
 minutes
AWS ECS vs. EKS vs. Elastic Beanstalk: A Comprehensive Guide

Confused about which AWS container service to use? This comprehensive guide compares the trade-offs between simplicity, control, and complexity for ECS, EKS, and Elastic Beanstalk to help you choose the right platform for your application.

Mélanie Dallé
Senior Marketing Manager
DevOps
AWS
7
 minutes
Migrating from ECS to EKS: A Complete Guide

Planning your ECS to EKS migration? Learn the strategic business case (portability, ecosystem access), navigate the step-by-step roadmap, and avoid common pitfalls (networking, resource allocation). Discover how Qovery automates EKS complexity for a seamless transition.

Morgan Perry
Co-founder
DevOps
 minutes
Fargate Simplicity vs. Kubernetes Power: Where Does Your Scaling Company Land?

Is Fargate too simple or Kubernetes too complex for your scale-up? Compare AWS Fargate vs. EKS on cost, control, and complexity. Then, see how Qovery automates Kubernetes, giving you its power without the operational headache or steep learning curve.

Mélanie Dallé
Senior Marketing Manager
DevOps
Cloud Migration
 minutes
FluxCD vs. ArgoCD: Why Qovery is the Better Way to Do GitOps

Dive into the ultimate FluxCD vs. ArgoCD debate! Learn the differences between these top GitOps tools (CLI vs. UI, toolkit vs. platform) and discover a third path: Qovery, the DevOps automation platform that abstracts away Kubernetes complexity, handles infrastructure, and lets you ship code faster.

Mélanie Dallé
Senior Marketing Manager
Qovery
 minutes
Our rebrand: setting a new standard for DevOps automation

Qovery unveils its new brand identity, reinforcing its mission to make DevOps simple, intuitive, and powerful. Discover how our DevOps automation platform simplifies infrastructure, scaling, security, and innovation across the full DevOps lifecycle.

Romaric Philogène
CEO & Co-founder

It’s time to rethink
the way you do DevOps

Say goodbye to DevOps overhead. Qovery makes infrastructure effortless, giving you full control without the trouble.