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.
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.
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.
JAVA
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?
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.
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.