Skip to main content
This guide starts a new infrastructure project from nothing. At the end, one configuration holds:
  • the AWS account Qovery manages, and an EKS cluster in it
  • a project with a staging and a production environment
  • a Postgres database and an application built from your git repository, in each environment
  • the deployment of both environments
Terraform keeps describing your infrastructure. Qovery runs it on your own cloud account: it creates and upgrades the cluster, builds and deploys the services, and handles DNS, TLS, autoscaling and rollbacks. You do not write Kubernetes manifests, Helm charts or EKS modules. The same configuration works with OpenTofu: the provider is published on both the Terraform Registry and the OpenTofu Registry. Run tofu wherever this guide runs terraform.
Prefer a module? The Qovery AWS starter module wraps this whole setup in one module block, for Terraform and OpenTofu.

Before you start

  • A Qovery organization. Create one for free at console.qovery.com.
  • An API token, exported as QOVERY_API_TOKEN. See Authentication.
  • An IAM role in your AWS account that Qovery can assume. The AWS installation guide creates it with a CloudFormation stack and gives you its ARN.
  • A git repository with a Dockerfile, and its application listening on port 8080. To deploy a public image instead, use qovery_container.

1. Declare the provider

main.tf

2. Connect the cloud account and create the cluster

main.tf
Qovery creates the VPC, the EKS cluster and its add-ons in your account, then keeps them upgraded. For GCP, Azure or Scaleway, see the examples of qovery_cluster.

3. Create the project and its environments

main.tf
Both environments share the cluster here. To isolate production, declare a second qovery_cluster and point the production environment at it.

4. Add the database and the application

main.tf

5. Deploy

main.tf
At runtime, DATABASE_URL holds postgresql://<login>:<password>@<host>:<port>/<database>. Then run:
The cluster takes the longest to create. Once it is ready, Qovery builds the application, deploys the database and the application in each environment, and gives the application a public URL with TLS. Follow the progress in the Qovery Console.
Destroying a qovery_deployment deletes its environment and all its services.

Next steps