public_ip_address_configuration offers public ip capability but could not get assigned public ips.
// want get this outpu
output "vmss_public_ips" {
value = ["${azurerm_virtual_machine_scale_set.vmss.public_ip_addresses}"]
}
// vmss creation : just like https://www.terraform.io/docs/providers/azurerm/r/virtual_machine_scale_set.html#public_ip_address_configuration
resource "azurerm_virtual_machine_scale_set" "vmss" {
name = "vmscaleset"
location = "West US 2"
resource_group_name = "test"
upgrade_policy_mode = "Manual"
lifecycle {
ignore_changes = ["sku"]
}
sku {
name = "Standard_F2"
tier = "Standard"
capacity = 4
}
storage_profile_image_reference {
publisher = "Canonical"
offer = "UbuntuServer"
sku = "16.04-LTS"
version = "latest"
}
storage_profile_os_disk {
caching = "ReadWrite"
create_option = "FromImage"
managed_disk_type = "Standard_LRS"
}
storage_profile_data_disk {
lun = 0
caching = "ReadWrite"
create_option = "Empty"
disk_size_gb = 10
}
os_profile {
computer_name_prefix = "testvm"
admin_username = "myadmin"
admin_password = "Passwword1234"
}
os_profile_linux_config {
disable_password_authentication = true
ssh_keys {
path = "/home/myadmin/.ssh/authorized_keys"
key_data = "${file("~/.ssh/demo_key.pub")}"
}
}
network_profile {
name = "terraformnetworkprofile"
primary = true
ip_configuration {
name = "TestIPConfiguration"
subnet_id = "${azurerm_subnet.test.id}"
load_balancer_backend_address_pool_ids = ["${azurerm_lb_backend_address_pool.bpepool.id}"]
load_balancer_inbound_nat_rules_ids = ["${element(azurerm_lb_nat_pool.lbnatpool.*.id, count.index)}"]
public_ip_address_configuration {
name = "testvmss"
idle_timeout = 30
domain_name_label = "testvmss"
}
}
}
}
https://github.com/terraform-providers/terraform-provider-azurerm/issues/340
I have the same problem. I'm able to retrieve it using the Azure CLI but cannot find a Terraform native way.
$ az vmss list-instance-public-ips -g civil-elk-test -n linux_challenges -o table
IdleTimeoutInMinutes IpAddress Name ProvisioningState PublicIpAddressVersion PublicIpAllocationMethod ResourceGroup ResourceGuid
---------------------- ------------- ------ ------------------- ------------------------ -------------------------- --------------- ------------------------------------
5 52.x.x.x asdf Succeeded IPv4 Dynamic civil-elk-test <redacted>
This issue has been fixed by the PR in issue #3763
This has been released in version 1.32.0 of the provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading. As an example:
provider "azurerm" {
version = "~> 1.32.0"
}
# ... other configuration ...
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!
Most helpful comment
This issue has been fixed by the PR in issue #3763