-
Notifications
You must be signed in to change notification settings - Fork 0
/
outputs.tf
54 lines (46 loc) · 1.75 KB
/
outputs.tf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
##############################################################################
# VSI Outputs
##############################################################################
output "ids" {
description = "The IDs of the VSI"
value = [
for virtual_server in ibm_is_instance.vsi :
virtual_server.id
]
}
output "vsi_security_group" {
description = "Security group for the VSI"
value = var.security_group == null ? null : ibm_is_security_group.security_group[var.security_group.name]
}
output "list" {
description = "A list of VSI with name, id, zone, and primary ipv4 address"
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
}
]
}
##############################################################################
##############################################################################
# Load Balancer Outputs
##############################################################################
output "lb_hostnames" {
description = "Hostnames for the Load Balancer created"
value = [
for load_balancer in ibm_is_lb.lb :
load_balancer.hostname
]
}
output "lb_security_groups" {
description = "Load Balancer security groups"
value = {
for load_balancer in var.load_balancers :
(load_balancer.name) => ibm_is_security_group.security_group[load_balancer.security_group.name] if load_balancer.security_group != null
}
}
##############################################################################