hashicorp / terraform-provider-azure-classic

Terraform Azure Classic (Service Management) provider
https://www.terraform.io/docs/providers/azure/
Mozilla Public License 2.0
3 stars 11 forks source link

Public IP address not shown in output until after 'terraform refresh' #28

Closed andretost closed 7 years ago

andretost commented 7 years ago

Terraform Version

0.9.11

Affected Resource(s)

azurerm_public_ip

If this issue appears to affect multiple resources, it may be an issue with Terraform's core, so please mention this.

Terraform Configuration Files

    name = "andretestip"
    location = "West US"
    resource_group_name = "${azurerm_resource_group.andretest.name}"
    public_ip_address_allocation = "dynamic"

    tags {
        environment = "AndreDemo"
    }
}

output "VM Public IP" {
  value = "${azurerm_public_ip.andretestip.ip_address}"
}

Debug Output

No warnings in the debug output.

Panic Output

No.

Expected Behavior

I would have expected to see the defined output at the end of running 'terraform apply'.

Actual Behavior

The apply completed successfully, there are no warnings or errors and my resources are deployed exactly as expected. However, the output does not show up at all. Only after I run 'terraform refresh', the output is now displayed. I assume the public IP address is allocated during resource creation and thus would assume that the ip_address attribute is know. I see that it is not listed in the state file after the original apply, and only gets added after running refresh. This may actually be working as designed, but I don't quite understand why the IP address is not available or shown, or what kind of workaround I could use to make it appear.

Steps to Reproduce

Important Factoids

References

tombuildsstuff commented 7 years ago

Hey @andretost

Thanks for opening this issue :)

This repository is for the older Azure Service Management Provider, whereas the resources you're referring too are for the Azure Resource Manager Provider. As such I've moved this issue over to the AzureRM Provider repository - where we'll take a look into this :)

Thanks!