21832: Allows custom backup retention period config.
authorLucas Di Pentima <lucas.dipentima@curii.com>
Thu, 13 Jun 2024 19:40:25 +0000 (16:40 -0300)
committerLucas Di Pentima <lucas.dipentima@curii.com>
Thu, 13 Jun 2024 19:40:25 +0000 (16:40 -0300)
Arvados-DCO-1.1-Signed-off-by: Lucas Di Pentima <lucas.dipentima@curii.com>

tools/salt-install/terraform/aws/services/locals.tf
tools/salt-install/terraform/aws/services/main.tf
tools/salt-install/terraform/aws/services/terraform.tfvars
tools/salt-install/terraform/aws/services/variables.tf

index 906a2cf636f053e853e9afbbb62c8b797ae4d2d8..d3f00231ba816e84f2b2121175570a164f45be16 100644 (file)
@@ -35,4 +35,5 @@ locals {
   rds_allocated_storage = var.rds_allocated_storage
   rds_max_allocated_storage = max(var.rds_max_allocated_storage, var.rds_allocated_storage)
   rds_instance_type = var.rds_instance_type
+  rds_backup_retention_period = var.rds_backup_retention_period
 }
index d1e88a8dcabcd8518993a486dc87b8bbe9e6ba5a..7ff6f4093f0560ec0c7929e7543a00bdbfb66651 100644 (file)
@@ -111,7 +111,7 @@ resource "aws_db_instance" "postgresql_service" {
   vpc_security_group_ids = [local.arvados_sg_id]
   db_subnet_group_name = aws_db_subnet_group.arvados_db_subnet_group[0].name
 
-  backup_retention_period = 7
+  backup_retention_period = local.rds_backup_retention_period
   publicly_accessible = false
   storage_encrypted = true
   multi_az = false
index 1a2e13d0424a4e3fcc7a0b821f1436b612a55509..1732465b19a5cbdda53b0209744cd3c969ea33b5 100644 (file)
@@ -31,6 +31,7 @@
 # rds_instance_type = "db.m5.xlarge"
 # rds_allocated_storage = 200
 # rds_max_allocated_storage = 1000
+# rds_backup_retention_period = 30
 
 # AWS secret's name which holds the SSL certificate private key's password.
 # Default: "arvados-ssl-privkey-password"
index 583ba709764eb0d4c67db04d9c00fe27dfcc0cdb..455cfb5f024094c7b9a5b5487c61012e912bcc10 100644 (file)
@@ -78,3 +78,9 @@ variable "rds_max_allocated_storage" {
   type = number
   default = 300
 }
+
+variable "rds_backup_retention_period" {
+  description = "RDS Backup retention (days). Set to 0 to disable."
+  type = number
+  default = 7
+}