I'm using Terraform to build and automate infrastructure and I'm having trouble in finding the solution to grab the output of an Azure WebApp, specifically the Public IP addresses used by that WebApp and use them as inputs to update a Cloudflare list.
output "webapp_ip" {
value = azurerm_linux_web_app.lwa.outbound_ip_addresses
}
will output something like this:
webapp_ip = "ip-address-1,ip-address-2,ip-address-3,ip-address-4"
and Cloudflare_list terraform resource receives data on the following format:
item {
value {
ip = "ip-address-1"
}
comment = "IP 1"}
item {
value {
ip = "ip-address-2"
}
comment = "IP 2"
}
I was thinking in dynamic lists but I don't know if it's the right way to go...