Overview
Complete Documentation: For detailed resource schemas, arguments, and attributes, visit the Qovery Terraform Provider on Terraform Registry.
Why Use Terraform with Qovery?
Infrastructure as Code
Version control your infrastructure alongside your application code
Reproducible Deployments
Deploy identical environments across dev, staging, and production
Team Collaboration
Review infrastructure changes through pull requests
Automation
Integrate with CI/CD pipelines for automated deployments
Getting Started
This guide provides a quick overview of the Qovery Terraform Provider. For comprehensive documentation including all resources, data sources, and configuration options, please refer to the official provider documentation on Terraform Registry.
Installation
Add the Qovery provider to your Terraform configuration:Authentication
To authenticate with the Qovery API, you need an API token. You can generate one from the Qovery Console. Set your token as an environment variable:Quick Start
1
Install Terraform
Download Terraform from terraform.io
2
Generate API Token
- Go to Qovery Console
- Navigate to Organization Settings → API Tokens
- Click “Generate Token” and copy it
3
Create Terraform Configuration
Create a
main.tf file:4
Initialize and Apply
Getting Your IDs
You’ll need various IDs from Qovery for your Terraform configuration:- Via Console
- Via Terraform Data Sources
- Via CLI
Organization ID:
- Go to Organization Settings
- Copy Organization ID from the URL or settings page
- Navigate to your project
- Copy Project ID from project settings
- Go to Settings → Clusters
- Copy Cluster ID from cluster details
Key Resources
The Qovery Terraform provider supports managing:Organization & Structure
Organization & Structure
qovery_organization- Organization settings (read-only)qovery_project- Projects to organize applicationsqovery_environment- Development, staging, production environmentsqovery_labels_group- Organize resources with labels
Applications & Services
Applications & Services
qovery_application- Containerized applicationsqovery_container- Custom container deploymentsqovery_job- Cron jobs and lifecycle jobsqovery_helm- Helm chart deployments
Databases
Databases
qovery_database- Managed databases (PostgreSQL, MySQL, MongoDB, Redis)- Container mode or cloud-managed mode
- Automatic connection string injection
Configuration
Configuration
qovery_environment_variable- Environment-level variablesqovery_environment_variable_alias- Variable aliasesqovery_environment_variable_override- Override variablesqovery_deployment_stage- Control deployment order
Infrastructure
Infrastructure
qovery_cluster- Kubernetes cluster configurationqovery_aws_credentials- AWS cloud credentialsqovery_scaleway_credentials- Scaleway cloud credentialsqovery_gcp_credentials- GCP cloud credentials
Integrations
Integrations
qovery_container_registry- Connect container registriesqovery_git_token- Git provider authenticationqovery_helm_repository- Add Helm chart repositories
Best Practices
Use Variables
Keep tokens in environment variables, not in code:Use Data Sources
Look up existing resources instead of hardcoding IDs:Organize with Modules
Create reusable modules for common patterns:Use Remote State
Store state remotely for team collaboration:Importing Existing Resources
Import existing Qovery resources into Terraform:Complete Documentation
Next Steps
Basic Application
Deploy your first application with Terraform
Application with Database
Deploy an application connected to a database
Multi-Environment Setup
Create dev, staging, and production environments
Advanced Patterns
Deployment pipelines, modules, and advanced configurations