Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow instance_class configuration even if serverless scaling config exists #247

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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
}
}

Expand Down
2 changes: 1 addition & 1 deletion variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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" {
Expand Down