Skip to content

Commit b65963e

Browse files
kmcquadeantonbabenko
authored andcommitted
Added intra subnet suffix. (#220)
* Added intra subnet suffix. * Fixed duplicate intra * Fixed tag
1 parent 03eded6 commit b65963e

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

main.tf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ resource "aws_route_table" "intra" {
174174

175175
vpc_id = "${local.vpc_id}"
176176

177-
tags = "${merge(map("Name", "${var.name}-intra"), var.tags, var.intra_route_table_tags)}"
177+
tags = "${merge(map("Name", "${var.name}-${var.intra_subnet_suffix}"), var.tags, var.intra_route_table_tags)}"
178178
}
179179

180180
################
@@ -281,7 +281,7 @@ resource "aws_subnet" "intra" {
281281
cidr_block = "${var.intra_subnets[count.index]}"
282282
availability_zone = "${element(var.azs, count.index)}"
283283

284-
tags = "${merge(map("Name", format("%s-intra-%s", var.name, element(var.azs, count.index))), var.tags, var.intra_subnet_tags)}"
284+
tags = "${merge(map("Name", format("%s-${var.intra_subnet_suffix}-%s", var.name, element(var.azs, count.index))), var.tags, var.intra_subnet_tags)}"
285285
}
286286

287287
##############

variables.tf

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,11 @@ variable "private_subnet_suffix" {
3838
default = "private"
3939
}
4040

41+
variable "intra_subnet_suffix" {
42+
description = "Suffix to append to intra subnets name"
43+
default = "intra"
44+
}
45+
4146
variable "database_subnet_suffix" {
4247
description = "Suffix to append to database subnets name"
4348
default = "db"

0 commit comments

Comments
 (0)