Skip to content

Commit

Permalink
Update private and public subnets to use tags variable (#17)
Browse files Browse the repository at this point in the history
* Update private and public subnets to use tags variable

* Updated README.md

Co-authored-by: actions-bot <58130806+actions-bot@users.noreply.github.com>
  • Loading branch information
drama17 and actions-bot authored Feb 19, 2020
1 parent ea13eb9 commit 21b9021
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions private.tf
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,13 @@ resource "aws_subnet" "private" {
availability_zone = var.availability_zone
cidr_block = cidrsubnet(var.cidr_block, ceil(log(var.max_subnets, 2)), count.index)

tags = {
tags = merge({
"Name" = "${module.private_label.id}${var.delimiter}${element(var.subnet_names, count.index)}"
"Stage" = module.private_label.stage
"Namespace" = module.private_label.namespace
"Named" = var.subnet_names[count.index]
"Type" = var.type
}
}, var.tags)
}

resource "aws_route_table" "private" {
Expand Down
4 changes: 2 additions & 2 deletions public.tf
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,13 @@ resource "aws_subnet" "public" {
availability_zone = var.availability_zone
cidr_block = cidrsubnet(var.cidr_block, ceil(log(var.max_subnets, 2)), count.index)

tags = {
tags = merge({
"Name" = "${module.public_label.id}${var.delimiter}${element(var.subnet_names, count.index)}"
"Stage" = module.public_label.stage
"Namespace" = module.public_label.namespace
"Named" = var.subnet_names[count.index]
"Type" = var.type
}
}, var.tags)
}

resource "aws_route_table" "public" {
Expand Down

0 comments on commit 21b9021

Please sign in to comment.