From c977de0152e0fd778902064a50ccc08f3f6a9daf Mon Sep 17 00:00:00 2001 From: Juho Majasaari Date: Tue, 31 Aug 2021 16:44:23 +0300 Subject: [PATCH] feat: Add support for naming Redshift subnet group --- README.md | 1 + main.tf | 4 ++-- variables.tf | 6 ++++++ 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 31c012146..525c15ccf 100644 --- a/README.md +++ b/README.md @@ -434,6 +434,7 @@ No modules. | [redshift\_outbound\_acl\_rules](#input\_redshift\_outbound\_acl\_rules) | Redshift subnets outbound network ACL rules | `list(map(string))` |
[
{
"cidr_block": "0.0.0.0/0",
"from_port": 0,
"protocol": "-1",
"rule_action": "allow",
"rule_number": 100,
"to_port": 0
}
]
| no | | [redshift\_route\_table\_tags](#input\_redshift\_route\_table\_tags) | Additional tags for the redshift route tables | `map(string)` | `{}` | no | | [redshift\_subnet\_assign\_ipv6\_address\_on\_creation](#input\_redshift\_subnet\_assign\_ipv6\_address\_on\_creation) | Assign IPv6 address on redshift subnet, must be disabled to change IPv6 CIDRs. This is the IPv6 equivalent of map\_public\_ip\_on\_launch | `bool` | `null` | no | +| [redshift\_subnet\_group\_name](#input\_redshift\_subnet\_group\_name) | Name of redshift subnet group | `string` | `null` | no | | [redshift\_subnet\_group\_tags](#input\_redshift\_subnet\_group\_tags) | Additional tags for the redshift subnet group | `map(string)` | `{}` | no | | [redshift\_subnet\_ipv6\_prefixes](#input\_redshift\_subnet\_ipv6\_prefixes) | Assigns IPv6 redshift subnet id based on the Amazon provided /56 prefix base 10 integer (0-256). Must be of equal length to the corresponding IPv4 subnet list | `list(string)` | `[]` | no | | [redshift\_subnet\_suffix](#input\_redshift\_subnet\_suffix) | Suffix to append to redshift subnets name | `string` | `"redshift"` | no | diff --git a/main.tf b/main.tf index e53abdfea..9581b1839 100644 --- a/main.tf +++ b/main.tf @@ -525,13 +525,13 @@ resource "aws_subnet" "redshift" { resource "aws_redshift_subnet_group" "redshift" { count = var.create_vpc && length(var.redshift_subnets) > 0 && var.create_redshift_subnet_group ? 1 : 0 - name = lower(var.name) + name = lower(coalesce(var.redshift_subnet_group_name, var.name)) description = "Redshift subnet group for ${var.name}" subnet_ids = aws_subnet.redshift.*.id tags = merge( { - "Name" = format("%s", var.name) + "Name" = format("%s", lower(coalesce(var.redshift_subnet_group_name, var.name))) }, var.tags, var.redshift_subnet_group_tags, diff --git a/variables.tf b/variables.tf index 584c6bcc0..ddd592534 100644 --- a/variables.tf +++ b/variables.tf @@ -502,6 +502,12 @@ variable "redshift_subnet_tags" { default = {} } +variable "redshift_subnet_group_name" { + description = "Name of redshift subnet group" + type = string + default = null +} + variable "redshift_subnet_group_tags" { description = "Additional tags for the redshift subnet group" type = map(string)