From 6bfe46f3420b546d017837605c0230ec2d027197 Mon Sep 17 00:00:00 2001 From: Paul Erickson Date: Wed, 11 Dec 2024 16:38:10 -0600 Subject: [PATCH 1/2] Allow instance_class configuration even if serverless scaling config exists --- main.tf | 2 +- variables.tf | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/main.tf b/main.tf index 8f8c60d..4ddb96e 100644 --- a/main.tf +++ b/main.tf @@ -5,7 +5,7 @@ locals { deployed_cluster_identifier = local.enabled ? coalesce(one(aws_rds_cluster.primary[*].id), one(aws_rds_cluster.secondary[*].id)) : "" db_subnet_group_name = one(aws_db_subnet_group.default[*].name) - instance_class = var.serverlessv2_scaling_configuration != null ? "db.serverless" : var.instance_type + instance_class = var.instance_type cluster_instance_count = local.enabled ? var.cluster_size : 0 is_regional_cluster = var.cluster_type == "regional" diff --git a/variables.tf b/variables.tf index 9a0cef7..f0e22b7 100644 --- a/variables.tf +++ b/variables.tf @@ -27,7 +27,7 @@ variable "subnets" { variable "instance_type" { type = string default = "db.t2.small" - description = "Instance type to use" + description = "Instance type to use. Use db.serverless for serverlessv2" } variable "cluster_identifier" { From 5f5162b66eb2a0ffb8a78652458eda949bbffa8a Mon Sep 17 00:00:00 2001 From: Paul Erickson Date: Fri, 13 Dec 2024 13:32:27 -0600 Subject: [PATCH 2/2] Fix another reference --- main.tf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main.tf b/main.tf index 4ddb96e..07b584b 100644 --- a/main.tf +++ b/main.tf @@ -324,7 +324,7 @@ resource "random_pet" "instance" { prefix = var.cluster_identifier == "" ? module.this.id : var.cluster_identifier keepers = { cluster_family = var.cluster_family - instance_class = var.serverlessv2_scaling_configuration != null ? "db.serverless" : var.instance_type + instance_class = local.instance_class } }