-
-
Notifications
You must be signed in to change notification settings - Fork 4.5k
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
Add ability to define custom DB Subnet Group Name #372
Changes from all commits
fad1657
8aa0c62
7ef67fc
4d8becc
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -359,7 +359,7 @@ resource "aws_subnet" "database" { | |||||
resource "aws_db_subnet_group" "database" { | ||||||
count = var.create_vpc && length(var.database_subnets) > 0 && var.create_database_subnet_group ? 1 : 0 | ||||||
|
||||||
name = lower(var.name) | ||||||
name = var.database_subnet_group_name != null ? lower(var.database_subnet_group_name) : lower(var.name) | ||||||
description = "Database subnet group for ${var.name}" | ||||||
subnet_ids = aws_subnet.database.*.id | ||||||
|
||||||
|
@@ -443,7 +443,7 @@ resource "aws_subnet" "elasticache" { | |||||
resource "aws_elasticache_subnet_group" "elasticache" { | ||||||
count = var.create_vpc && length(var.elasticache_subnets) > 0 && var.create_elasticache_subnet_group ? 1 : 0 | ||||||
|
||||||
name = var.name | ||||||
name = var.elasticache_subnet_group_name != null ? lower(var.elasticache_subnet_group_name) : lower(var.name) | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You added There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ya, not sure why some have
Suggested change
|
||||||
description = "ElastiCache subnet group for ${var.name}" | ||||||
subnet_ids = aws_subnet.elasticache.*.id | ||||||
} | ||||||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,6 +10,18 @@ variable "name" { | |
default = "" | ||
} | ||
|
||
variable "database_subnet_group_name" { | ||
description = "Name to be used on DB Subnet Group resource as identifier" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It would be nice to add rules for the DB subnet group name. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. agreed - I think this would be helpful for users to know if there is criteria that must be followed |
||
type = string | ||
default = null | ||
} | ||
|
||
variable "elasticache_subnet_group_name" { | ||
description = "Name to be used on Elasticache Subnet Group resource as identifier" | ||
type = string | ||
default = null | ||
} | ||
|
||
variable "cidr" { | ||
description = "The CIDR block for the VPC. Default value is a valid CIDR, but not acceptable by AWS and should be overridden" | ||
type = string | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should be able to get away with: