F5Networks / terraform-aws-bigip-module

Terraform module for Deploying BIG-IP in AWS
Apache License 2.0
10 stars 21 forks source link

Network interface ID needed in output #27

Closed JeffGiroux closed 2 years ago

JeffGiroux commented 2 years ago

User would like to take network interface IDs and use the value in other resources such as AWS route tables. Based on the current BIG-IP module, the ID of the network interface is needed along with the IP. The IP addresses are already in the output. We are missing the ID of the network interface IDs.

Similar to Azure ticket too - https://github.com/F5Networks/terraform-azure-bigip-module/issues/29

workaround

Tested this and it works...

output "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
  }
}

All though, I see you have this in locals too. But it's commented.

  //bigip_nics       = concat(aws_network_interface.public.*.id, aws_network_interface.external_private.*.id,aws_network_interface.private.*.id)
KrithikaChidambaram commented 2 years ago

This request is now being tracked internally with ID INFRAANO-857

RavinderReddyF5 commented 2 years ago

@JeffGiroux fixed in v1.1.7, please verify