You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
For some reason, I need to assign several IPs to one load balancer. After some reading, I know that in order to get the dynamic public ip of the load balancer, I should use azurerm_public_ip data source. However, this doesn't work when there are multiple IPs.
Azurerm_public_ip data sources doesn't suport interpolation, so I have to create a lot of data sources.
data "azurerm_public_ip" "lb_ip1" {
name = "${azurerm_public_ip.ip.0.name}"
resource_group_name = "${azurerm_resource_group.group.name}"
depends_on = ["azurerm_lb.lb"]
}
data "azurerm_public_ip" "lb_ip2" {
name = "${azurerm_public_ip.ip.1.name}"
resource_group_name = "${azurerm_resource_group.group.name}"
depends_on = ["azurerm_lb.lb"]
}
output "lb_ip1" {
value = "${data.azurerm_public_ip.lb_ip1.ip_address}"
}
output "lb_ip2" {
value = "${data.azurerm_public_ip.lb_ip2.ip_address}"
}
Terraform failed to apply the tf file. The error message is
* module.main.output.lb_ip1: Resource 'data.azurerm_public_ip.lb_ip1' does not have attribute 'ip_address' for variable 'data.azurerm_public_ip.lb_ip1.ip_address'
* module.main.output.lb_ip2: Resource 'data.azurerm_public_ip.lb_ip2' does not have attribute 'ip_address' for variable 'data.azurerm_public_ip.lb_ip2.ip_address'
The data sources depends on lb resource, dynamic IP is created when the load balancer with this IP assigned is active. There should be no issue getting the IP. Is there any issue with the usage here ? And is there any better solution to get all the IP addresses of the load balancer ?
The text was updated successfully, but these errors were encountered:
It appears that as of 1.1.0 the ip_address property is only set if the DNSSettings property exists. We deploy virtual machines without domain name labels, and yesterday our plans were suddenly no longer able to retrieve the public IP address as an output variable.
As @genevieve pointed this in the commit, it appears that simply moving the ip_address logic outside the DNSSettings block should fix the issue.
Thanks for opening this issue - apologies for the delayed response here!
This appears to be a duplicate of #771 which has been fixed via #772 which has now been released in v1.1.1 of the Azure Provider earlier today. Would you be able to upgrade to this version and see if that solves your issue?
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.
If you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. If you feel I made an error 🤖 🙉 , please reach out to my human friends 👉 hashibot-feedback@hashicorp.com. Thanks!
ghost
locked and limited conversation to collaborators
Mar 31, 2020
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
For some reason, I need to assign several IPs to one load balancer. After some reading, I know that in order to get the dynamic public ip of the load balancer, I should use azurerm_public_ip data source. However, this doesn't work when there are multiple IPs.
Here is part of the tf file:
Azurerm_public_ip data sources doesn't suport interpolation, so I have to create a lot of data sources.
Terraform failed to apply the tf file. The error message is
The data sources depends on lb resource, dynamic IP is created when the load balancer with this IP assigned is active. There should be no issue getting the IP. Is there any issue with the usage here ? And is there any better solution to get all the IP addresses of the load balancer ?
The text was updated successfully, but these errors were encountered: