Skip to content

Commit

Permalink
feat: additional output for vsi with fips (#52)
Browse files Browse the repository at this point in the history
* feat: Additional output for vsi with fips

* Fix tflint error

Co-authored-by: Adam Geiger <[email protected]>
  • Loading branch information
argeiger and argeiger authored Aug 12, 2022
1 parent 046b05b commit 7a31164
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,7 @@ No modules.

| Name | Description |
|------|-------------|
| <a name="output_fip_list"></a> [fip\_list](#output\_fip\_list) | 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. |
| <a name="output_ids"></a> [ids](#output\_ids) | The IDs of the VSI |
| <a name="output_lb_hostnames"></a> [lb\_hostnames](#output\_lb\_hostnames) | Hostnames for the Load Balancer created |
| <a name="output_lb_security_groups"></a> [lb\_security\_groups](#output\_lb\_security\_groups) | Load Balancer security groups |
Expand Down
16 changes: 16 additions & 0 deletions outputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,26 @@ output "list" {
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
vpc_id = var.vpc_id
}
]
}

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 :
{
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
vpc_id = var.vpc_id
} if var.enable_floating_ip == true
]
}

##############################################################################

##############################################################################
Expand Down

0 comments on commit 7a31164

Please sign in to comment.