From e7fa677846ed91749b90a31d8ba8fc25eca1ac30 Mon Sep 17 00:00:00 2001
From: Krish Moodbidri <krish94@uab.edu>
Date: Fri, 17 Nov 2023 15:59:31 -0600
Subject: [PATCH] test- replaced count in output section of code with a for
 loop

---
 ohpc-instance/main.tf | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/ohpc-instance/main.tf b/ohpc-instance/main.tf
index af25b34..7ce5fba 100644
--- a/ohpc-instance/main.tf
+++ b/ohpc-instance/main.tf
@@ -64,7 +64,7 @@ resource "openstack_compute_floatingip_associate_v2" "ohpc" {
   instance_id = openstack_compute_instance_v2.ohpc.id
 }
 
-# Attach a volume
+# Attach volumes
 resource "openstack_compute_volume_attach_v2" "volume_attach" {
   count       = length(var.vol_ids)
   instance_id = openstack_compute_instance_v2.ohpc.id
@@ -72,7 +72,7 @@ resource "openstack_compute_volume_attach_v2" "volume_attach" {
 }
 
 output "xdmod_instance_id" {
-    value = openstack_compute_instance_v2.ohpc[count.index].id
+  value = [for instance in openstack_compute_instance_v2.ohpc : instance.id]
 }
 
 output "ssh_host" {
@@ -80,5 +80,5 @@ output "ssh_host" {
 }
 
 output "device" {
-    value = openstack_compute_volume_attach_v2.volume_attach[count.index].device
+  value = [for volume in openstack_compute_volume_attach_v2.volume_attach : volume.device]
 }
-- 
GitLab