Skip to content

Commit

Permalink
fix: the fip output failing due to invalid key (#545)
Browse files Browse the repository at this point in the history
  • Loading branch information
Aashiq-J committed Sep 27, 2023
1 parent 10d15e8 commit 52400ba
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions outputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,13 @@ output "vsi_security_group" {
output "list" {
description = "A list of VSI with name, id, zone, and primary ipv4 address"
value = [
for virtual_server in ibm_is_instance.vsi :
for vsi_key, virtual_server in ibm_is_instance.vsi :
{
name = virtual_server.name
id = virtual_server.id
zone = virtual_server.zone
ipv4_address = virtual_server.primary_network_interface[0].primary_ipv4_address
floating_ip = var.enable_floating_ip ? ibm_is_floating_ip.vsi_fip[virtual_server.name].address : null
floating_ip = var.enable_floating_ip ? ibm_is_floating_ip.vsi_fip[vsi_key].address : null
vpc_id = var.vpc_id
}
]
Expand All @@ -33,13 +33,13 @@ output "list" {
output "fip_list" {
description = "A list of VSI with name, id, zone, and primary ipv4 address, and floating IP. This list only contains instances with a floating IP attached."
value = [
for virtual_server in ibm_is_instance.vsi :
for vsi_key, virtual_server in ibm_is_instance.vsi :
{
name = virtual_server.name
id = virtual_server.id
zone = virtual_server.zone
ipv4_address = virtual_server.primary_network_interface[0].primary_ipv4_address
floating_ip = var.enable_floating_ip ? ibm_is_floating_ip.vsi_fip[virtual_server.name].address : null
floating_ip = var.enable_floating_ip ? ibm_is_floating_ip.vsi_fip[vsi_key].address : null
vpc_id = var.vpc_id
} if var.enable_floating_ip == true
]
Expand Down

0 comments on commit 52400ba

Please sign in to comment.