Skip to content

Commit

Permalink
Allow to override the subnet group name
Browse files Browse the repository at this point in the history
  • Loading branch information
iuriaranda committed Dec 30, 2022
1 parent c455203 commit a2c3e7c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion rds/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ locals {
}

resource "aws_db_subnet_group" "rds" {
name = length(var.name) == 0 ? "${var.project}-${var.environment}${var.tag}-rds" : var.name
name = coalesce(var.subnet_group_name_override, var.name, "${var.project}-${var.environment}${var.tag}-rds")
description = "Our main group of subnets"
subnet_ids = var.subnets
}
Expand Down
6 changes: 6 additions & 0 deletions rds/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,12 @@ variable "name" {
default = ""
}

variable "subnet_group_name_override" {
type = string
description = "Override the name of the created subnet group"
default = null
}

variable "monitoring_interval" {
description = "The interval, in seconds, between points when Enhanced Monitoring metrics are collected for the DB instance. To disable collecting Enhanced Monitoring metrics, specify 0. Valid Values: 0, 1, 5, 10, 15, 30, 60."
default = "0"
Expand Down

0 comments on commit a2c3e7c

Please sign in to comment.