Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add secondary interface output address #553

Merged
merged 10 commits into from
Oct 10, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions module-metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -376,7 +376,7 @@
"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.",
"pos": {
"filename": "outputs.tf",
"line": 33
"line": 34
}
},
"ids": {
Expand All @@ -392,15 +392,15 @@
"description": "Hostnames for the Load Balancer created",
"pos": {
"filename": "outputs.tf",
"line": 54
"line": 56
}
},
"lb_security_groups": {
"name": "lb_security_groups",
"description": "Load Balancer security groups",
"pos": {
"filename": "outputs.tf",
"line": 62
"line": 64
}
},
"list": {
Expand Down
26 changes: 14 additions & 12 deletions outputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,13 @@ output "list" {
value = [
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[vsi_key].address : null
vpc_id = var.vpc_id
name = virtual_server.name
id = virtual_server.id
zone = virtual_server.zone
ipv4_address = virtual_server.primary_network_interface[0].primary_ipv4_address
secondary_ipv4_address = length(virtual_server.network_interfaces) == 0 ? null : virtual_server.network_interfaces[0].primary_ipv4_address
floating_ip = var.enable_floating_ip ? ibm_is_floating_ip.vsi_fip[vsi_key].address : null
vpc_id = var.vpc_id
}
]
}
Expand All @@ -35,12 +36,13 @@ output "fip_list" {
value = [
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[vsi_key].address : null
vpc_id = var.vpc_id
name = virtual_server.name
id = virtual_server.id
zone = virtual_server.zone
ipv4_address = virtual_server.primary_network_interface[0].primary_ipv4_address
secondary_ipv4_address = length(virtual_server.network_interfaces) == 0 ? null : virtual_server.network_interfaces[0].primary_ipv4_address
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