diff --git a/main.tf b/main.tf index 24eab43..8632f99 100644 --- a/main.tf +++ b/main.tf @@ -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.*) +} diff --git a/outputs.tf b/outputs.tf index fe93d9e..77f9d94 100644 --- a/outputs.tf +++ b/outputs.tf @@ -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)" +}