Skip to content

Commit

Permalink
Add private subnet cidr blocks output
Browse files Browse the repository at this point in the history
  • Loading branch information
snemetz committed Jan 8, 2019
1 parent e1143d5 commit cf8a54c
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
4 changes: 4 additions & 0 deletions outputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,7 @@ output "public_route_table_ids" {
output "private_route_table_ids" {
value = ["${aws_route_table.private.*.id}"]
}

output "private_subnet_cidr_blocks" {
value = ["${data.aws_subnet.private_subnets.*.cidr_block}"]
}
5 changes: 5 additions & 0 deletions private.tf
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,11 @@ resource "aws_subnet" "private" {

tags = "${merge(module.private_subnet_label.tags, map("Name",format("%s%s%s", module.private_subnet_label.id, var.delimiter, replace(element(var.availability_zones, count.index),"-",var.delimiter))))}"
}
data "aws_subnet" "private_subnets" {
count = "${length(var.availability_zones)}"
id = "${element(aws_subnet.private.*.id, count.index)}"
}


resource "aws_route_table" "private" {
count = "${length(var.availability_zones)}"
Expand Down

0 comments on commit cf8a54c

Please sign in to comment.