Add MySQL DB cluster and database for crater app

This commit is contained in:
Danny Grove 2024-03-26 00:11:14 -07:00
parent 1b6e5156f4
commit 6d149d96e5
Signed by: drgrove
GPG Key ID: E1F4160251DB4C2E
1 changed files with 20 additions and 0 deletions

View File

@ -69,6 +69,26 @@ module "digitalocean_database_cluster" {
digitalocean_region = data.digitalocean_region.provided.slug
}
# Crater App requires MySQL currently, when it adds PG support we should migrate
#
module "digitalocean_mysql_database_cluster" {
source = "../../terraform_modules/digitalocean_database_cluster"
cluster_name = "distrust-mysql"
db_engine = "mysql"
db_version = "8"
size = "db-s-1vcpu-2gb"
node_count = 1
databases = [{
name = "crater",
create_default_superuser = true,
}]
vpc_id = digitalocean_vpc.main.id
digitalocean_region = data.digitalocean_region.provided.slug
}
locals {
database_host = module.digitalocean_database_cluster.database_cluster.private_host
database_port = module.digitalocean_database_cluster.database_cluster.port