From 7c505c1f7eb6289f1c298c426b74888a55206a33 Mon Sep 17 00:00:00 2001 From: Mrugesh Mohapatra <1884376+raisedadead@users.noreply.github.com> Date: Mon, 31 Jul 2023 12:17:34 +0530 Subject: [PATCH] feat: add managed DB for news (#572) --- .../stg-cluster-oldeworld/next-05-nws.tf | 23 +++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/terraform/stg-cluster-oldeworld/next-05-nws.tf b/terraform/stg-cluster-oldeworld/next-05-nws.tf index 42e93112..5731b89f 100644 --- a/terraform/stg-cluster-oldeworld/next-05-nws.tf +++ b/terraform/stg-cluster-oldeworld/next-05-nws.tf @@ -132,3 +132,26 @@ resource "linode_domain_record" "stg_oldeworld_nws_dnsrecord__private" { target = linode_instance.stg_oldeworld_nws[each.key].private_ip_address ttl_sec = 120 } + +resource "linode_database_mysql" "stg_oldeworld_nws_db" { + engine_id = "mysql/5.7.39" + label = "stg-db-oldeworld-nws" + region = var.region + type = "g6-standard-2" + + allow_list = flatten([ + [for i in linode_instance.stg_oldeworld_nws : "${i.private_ip_address}/32"] + ]) + + cluster_size = 3 + replication_type = "asynch" + ssl_connection = true + + updates { + day_of_week = "saturday" + duration = 1 + frequency = "monthly" + hour_of_day = 22 + week_of_month = 2 + } +}