Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

azurerm_lb with multiple IP configurations doesn't expose multiple private_ip_address outputs #628

Closed
tevert opened this issue Dec 13, 2017 · 1 comment

Comments

@tevert
Copy link
Contributor

tevert commented Dec 13, 2017

Terraform Version

Terraform v0.11.0

  • provider.azurerm v0.3.3

Affected Resource(s)

Please list the resources as a list, for example:

  • azurerm_lb (frontend_ip_configuration)

Terraform Configuration Files

resource "azurerm_lb" "firewall_LB" {
  name                = "firewall-LB"
  location            = "${var.resource_location}"
  resource_group_name = "${var.resource_group}"

  frontend_ip_configuration {
    name                          = "PrivateFrontIP"
    private_ip_address_allocation = "Dynamic"
    subnet_id                     = "${azurerm_virtual_network.firewall_vnet.id}/subnets/${azurerm_subnet.firewall_untrust_subnet.name}"
  }

  frontend_ip_configuration {
    name                          = "PrivateBackIP"
    private_ip_address_allocation = "Dynamic"
    subnet_id                     = "${azurerm_virtual_network.firewall_vnet.id}/subnets/${azurerm_subnet.firewall_trust_subnet.name}"
  }
}

output "load_balancer_ip" {
    value = "${azurerm_lb.firewall_LB.private_ip_address[1]}"
}

Expected Behavior

Output should have been filled with the private IP of the second frontend_ip_configuration

Actual Behavior

Error: Error refreshing state: 1 error(s) occurred:

* module.firewall.output.load_balancer_ip: At column 44, line 1: invalid index operation into non-indexable type: TypeString in:

${azurerm_lb.firewall_LB.private_ip_address[1]}

Important Factoids

Relevant code appears to be here: https://github.com/terraform-providers/terraform-provider-azurerm/blob/58ad2a32660d05291ca5569651c28c8a0c92bf81/azurerm/resource_arm_loadbalancer.go#L184

Instead of having a singular string output, can this instead be an array for however many IP configurations are present? Any particular reason why it was written this way initially, with a break? Is there a different way to access a particular IP configuration?

@ghost
Copy link

ghost commented Apr 1, 2020

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 👉 [email protected]. Thanks!

@ghost ghost locked and limited conversation to collaborators Apr 1, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants