Managed Database Settings

INFORMATION

Relevant information to this issue:

  • databases: Managed Database (AWS RDS)

ISSUE

When Qovery deploys a database through AWS (RDS), it recommends to make it multi-az and to turn on autoscaling. Is that something I can do through qovery, or can I just turn it on in AWS?

HOW TO REPRODUCE

Deploy a managed database with AWS as your cloud provider.

Hi @colin ,

As you know, Qovery provides a built-in RDS instance that you can deploy in one click; however, as you mentioned, some multi-AZ options are not configurable. Qovery is not configurable today, but it will be in the future. To overcome this limitation, I’d recommend deploying your RDS instance using Terraform via a Qovery Lifecycle Job.

You can look at this guide explaining exactly how to do it with a MySQL RDS instance.

If you are unfamiliar with Terraform, I can point you to some resources. But basically, it’s a descriptive way of provisioning online services (including AWS RDS).

What the Terraform looks like

In your case, you might need to change this main.tf to target Postgres instead of MySQL (I assume you use Postgres) and add the property multi_az. The final results looks like this

terraform {
  required_providers {
    aws = {
      source  = "hashicorp/aws"
      version = "~> 3.27"
    }
  }

  backend "s3" {}

  required_version = ">= 0.14.9"
}

provider "aws" {
  region     = var.aws_region
  access_key = var.aws_access_key_id
  secret_key = var.aws_secret_access_key
}


resource "aws_db_instance" "rds_instance" {
  allocated_storage   = 20
  storage_type        = "gp2"
  engine              = "postgres"
  engine_version      = "14"
  instance_class      = "db.t2.micro"
  name                = "myDbName${split("-", var.qovery_environment_id)[0]}"
  username            = "yourDbUsername"
  password            = "yourPassword"
  publicly_accessible = true
  skip_final_snapshot = true
  multi_az            = true
}

You will probably need to adjust some parameters. I just wanted to give you an idea of what it looks like.


Let me know if you need further help for this @colin