Closed JeffGiroux closed 2 years ago
I found a workaround via AZ cli as a null_resource...still hacky though. There is a source of truth issue still since both the null_resource and the module bigip will try to manage the NIC. Upon next update, the tags will either be there or not due to this workaround. Not consistent and not recommend...but gets me by for now.
# BIG-IP 1 NIC info
data "azurerm_network_interface" "bigip_ext" {
name = format("%s-ext-nic-public-0", element(split("-f5vm01", element(split("/", module.bigip.bigip_instance_ids), 8)), 0))
resource_group_name = azurerm_resource_group.main.name
}
data "azurerm_network_interface" "bigip_int" {
name = format("%s-int-nic0", element(split("-f5vm01", element(split("/", module.bigip.bigip_instance_ids), 8)), 0))
resource_group_name = azurerm_resource_group.main.name
}
# Add Cloud Failover tags to BIG-IP 1 NICs
resource "null_resource" "f5vm01_nic_tags" {
depends_on = [module.bigip]
# Running AZ CLI to add tags
provisioner "local-exec" {
command = <<-EOF
#!/bin/bash
az network nic update -g ${azurerm_resource_group.main.name} -n ${data.azurerm_network_interface.bigip_ext.name} --set tags.f5_cloud_failover_label=bigip-failover-cluster123 tags.f5_cloud_failover_nic_map=external
az network nic update -g ${azurerm_resource_group.main.name} -n ${data.azurerm_network_interface.bigip_int.name} --set tags.f5_cloud_failover_label=bigip-failover-cluster123 tags.f5_cloud_failover_nic_map=internal
EOF
}
}
This request is now being tracked internally with ID INFRAANO-856
Hi @JeffGiroux , Issue fixed in v1.2.5
User would like to add unique tags per NIC. Currently, the var.tags is available but it is applied to all resources.
Use Case
The use case would be for F5 Cloud Failover Extension to satisfy Azure requirements in which NICs must be tagged with the failover labels, and nic maps. Specifically the primary IP on the external NIC must be tagged with 2 tags for example. Then the public IPs must be tagged too.
https://clouddocs.f5.com/products/extensions/f5-cloud-failover/latest/userguide/azure.html
Current behavior
Successful deployment of BIG-IP, but all NICs are tagged the same. There is no way to specify unique tags per NIC. In order to setup HA failover, manual workaround needed to add tags after deployment to NICs is needed.
Workaround
You must manually tag after but it won't be in time for onboarding to be successful. Still though, since the BIG-IP module doesn't contain those tags in state...upon next run...it will wipe out the values.
There is an aws_ec2_tag resource in the AWS provider, but I cannot find an equivalent for the Azure provider. See similar ticket in AWS BIG-IP module here - https://github.com/F5Networks/terraform-aws-bigip-module/issues/22
Suggestion
Add ability for the module parameters on the subnet lines to take additional tags.
Current...
With tags...