Skip to content

Commit

Permalink
Add outputs to module that should be useful to module consumers
Browse files Browse the repository at this point in the history
  • Loading branch information
dmotles committed Mar 18, 2020
1 parent aef41c1 commit d0dd59a
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
4 changes: 4 additions & 0 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,7 @@ resource "aws_instance" "node" {
vpc_security_group_ids = var.security_group_ids
tags = merge({ Name = "${var.cluster_name} ${count.index + 1}" }, var.tags)
}

locals {
all_nodes = concat([aws_instance.leader_node], aws_instance.node.*)
}
15 changes: 15 additions & 0 deletions outputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,18 @@
* information or intellectual property contained herein is strictly forbidden,
* unless separate prior written permission has been obtained from Qumulo, Inc.
*/

output "instance_ids" {
value = local.all_nodes.*.id
description = "EC2 Instance IDs for all nodes in the cluster"
}

output "private_ips" {
value = local.all_nodes.*.private_ip
description = "EC2 instance private IPs"
}

output "public_ips" {
value = local.all_nodes.*.public_ip
description = "EC2 instance public IPs (if set)"
}

0 comments on commit d0dd59a

Please sign in to comment.