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

public_ip_enabled variable no longer correctly calculating #25

Open
moorma01 opened this issue Apr 13, 2023 · 3 comments
Open

public_ip_enabled variable no longer correctly calculating #25

moorma01 opened this issue Apr 13, 2023 · 3 comments

Comments

@moorma01
Copy link

Azure-Terraform/terraform-azurerm-virtual-machine?ref=v3.0.1

When setting public_ip_enabled to false or letting it default (false) Terraform Plans fail with the error below:

│ Error: parsing Azure ID: parse "": empty url │ │ with module.vms["match-host-01"].azurerm_network_interface.dynamic, │ on .terraform/modules/vms/main.tf line 60, in resource "azurerm_network_interface" "dynamic": │ 60: public_ip_address_id = var.public_ip_enabled ? azurerm_public_ip.primary[0].id : "" │

When setting the public_ip_eanbled variable to true the new infrastructure is planned successfully.

Instead of an empty string should we be passing in null? for azurerm_public_ip?

@baolongkms
Copy link

I have the same issues when I provision a VM using this module

@moorma01
Copy link
Author

moorma01 commented May 5, 2023

@baolongkms, I believe this VM repository has been abandoned by whoever was maintaining it.

I forked off of this one and changed line 60 in main.tf to pass a null value instead of an empty string.
public_ip_address_id = var.public_ip_enabled ? azurerm_public_ip.primary[0].id : null

@wcarty
Copy link
Contributor

wcarty commented Oct 7, 2024

I implemented a fix for this in v3.0.2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants