Skip to content

Commit

Permalink
Add Outputs for public & private subnet ids (#5)
Browse files Browse the repository at this point in the history
* Added outputs.tf

* Added `_ids` suffix to `outputs.tf` since the outputs are subnet IDs
  • Loading branch information
aknysh authored Aug 17, 2017
1 parent 21f9024 commit 4611bb2
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 1 deletion.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,6 @@

# Module directory
.terraform/

.idea
*.iml
2 changes: 1 addition & 1 deletion main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ data "aws_vpc" "default" {
id = "${var.vpc_id}"
}

# Get all subnets from the necessary vpc
# Get all subnets from the VPC
data "aws_subnet_ids" "all" {
vpc_id = "${data.aws_vpc.default.id}"
}
7 changes: 7 additions & 0 deletions outputs.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
output "public_subnet_ids" {
value = ["${aws_subnet.public.*.id}"]
}

output "private_subnet_ids" {
value = ["${aws_subnet.private.*.id}"]
}

0 comments on commit 4611bb2

Please sign in to comment.