forked from F5Networks/terraform-aws-bigip-module
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathoutputs.tf
74 lines (65 loc) · 3.92 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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
# BIG-IP Management Public IP Addresses
output "mgmtPublicIP" {
description = "List of BIG-IP public IP addresses for the management interfaces"
value = concat(aws_instance.f5_bigip.*.public_ip)[0]
}
# BIG-IP Management Public DNS
output "mgmtPublicDNS" {
description = "List of BIG-IP public DNS records for the management interfaces"
value = concat(aws_instance.f5_bigip.*.public_dns)[0]
}
# BIG-IP Management Port
output "mgmtPort" {
description = "HTTPS Port used for the BIG-IP management interface"
value = local.total_nics > 1 ? "443" : "8443"
}
output "f5_username" {
value = (var.custom_user_data == null) ? var.f5_username : "Username as provided in custom runtime-init"
}
output "bigip_password" {
description = "Password for bigip user ( if dynamic_password is choosen it will be random generated password or if aws_secretmanager_auth is choosen it will be aws secretmanager secret_id )"
value = (var.custom_user_data == null) ? ((var.f5_password == "") ? (var.aws_secretmanager_auth ? var.aws_secretmanager_secret_id : random_string.dynamic_password.result) : var.f5_password) : "Password as provided in custom runtime-init"
}
output "private_addresses" {
description = "List of BIG-IP private addresses"
value = {
mgmt_private = {
private_ip = length(compact(local.mgmt_public_private_ip_primary)) > 0 ? aws_network_interface.mgmt.*.private_ip : aws_network_interface.mgmt1.*.private_ip
private_ips = length(compact(local.mgmt_public_private_ip_primary)) > 0 ? aws_network_interface.mgmt.*.private_ips : aws_network_interface.mgmt1.*.private_ips
}
public_private = {
private_ip = length(concat(try(aws_network_interface.public.*.private_ip, []))) > 0 ? aws_network_interface.public.*.private_ip : aws_network_interface.public1.*.private_ip
private_ips = length(compact(local.external_public_private_ip_primary)) > 0 ? aws_network_interface.public.*.private_ips : aws_network_interface.public1.*.private_ips
}
external_private = {
private_ip = length(compact(local.external_private_ip_primary)) > 0 ? aws_network_interface.external_private.*.private_ip : aws_network_interface.external_private1.*.private_ip
private_ips = length(compact(local.external_private_ip_primary)) > 0 ? aws_network_interface.external_private.*.private_ips : aws_network_interface.external_private1.*.private_ips
}
internal_private = {
private_ip = length(compact(local.internal_private_ip_primary)) > 0 ? aws_network_interface.private.*.private_ip : aws_network_interface.private1.*.private_ip
private_ips = length(compact(local.internal_private_ip_primary)) > 0 ? aws_network_interface.private.*.private_ips : aws_network_interface.private1.*.private_ips
}
}
}
output "public_addresses" {
description = "List of BIG-IP public addresses"
value = {
external_primary_public = concat(try(aws_eip.ext-pub.*.public_ip, []))
external_secondary_public = concat(try(aws_eip.vip.*.public_ip, []))
}
}
output "onboard_do" {
value = local.total_nics > 1 ? (local.total_nics == 2 ? local.clustermemberDO2 : local.clustermemberDO3) : local.clustermemberDO1
}
output "bigip_instance_ids" {
value = concat(aws_instance.f5_bigip.*.id)[0]
}
output "bigip_nic_ids" {
description = "List of BIG-IP network interface IDs"
value = {
mgmt_private = length(compact(local.mgmt_public_private_ip_primary)) > 0 ? aws_network_interface.mgmt.*.id : aws_network_interface.mgmt1.*.id
public_private = length(concat(try(aws_network_interface.public.*.private_ip, []))) > 0 ? aws_network_interface.public.*.id : aws_network_interface.public1.*.id
external_private = length(compact(local.external_private_ip_primary)) > 0 ? aws_network_interface.external_private.*.id : aws_network_interface.external_private1.*.id
internal_private = length(compact(local.internal_private_ip_primary)) > 0 ? aws_network_interface.private.*.id : aws_network_interface.private1.*.id
}
}