I cannot seem to retrieve the public ip address output of Terraform for next step in build pipeline in AzureDevops.
Terraform state pull works and outputs to json file, cannot grep on output.
Terraform state show [options] ADDRESS does not support azure backend so cannot use or grep or filter the output
also tried to store as file and read in the value.
resource "local_file" "foo" {
content = "foo!"
filename = "${path.module}/foo.bar"
}
data "azurerm_public_ip" "buildserver-pip" {
name = "${azurerm_public_ip.buildserver-pip.name}"
resource_group_name = "${azurerm_virtual_machine.buildserver.resource_group_name}"
}
output "public_ip_address" {
value = "${data.azurerm_public_ip.buildserver-pip.ip_address}"
}
expect the public ip address to be passed out so can be used in ansible playbooks, bash or python script in next step