Skip to content

Commit

Permalink
Added intra subnet suffix. (#220)
Browse files Browse the repository at this point in the history
* Added intra subnet suffix.

* Fixed duplicate intra

* Fixed tag
  • Loading branch information
kmcquade authored and antonbabenko committed Feb 21, 2019
1 parent 03eded6 commit b65963e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
4 changes: 2 additions & 2 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ resource "aws_route_table" "intra" {

vpc_id = "${local.vpc_id}"

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

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

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

##############
Expand Down
5 changes: 5 additions & 0 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,11 @@ variable "private_subnet_suffix" {
default = "private"
}

variable "intra_subnet_suffix" {
description = "Suffix to append to intra subnets name"
default = "intra"
}

variable "database_subnet_suffix" {
description = "Suffix to append to database subnets name"
default = "db"
Expand Down

0 comments on commit b65963e

Please sign in to comment.