Fixing output errors
In the previous recipe, we saw how to troubleshoot and fix for_each
errors.
Now, using the same configuration, we can see another scenario to get the hostname for a created Azure web app. This will allow us to test the availability of the web app just after its creation. Note that when testing the avilabilty of the web app, we are simply working on the output render.
In this recipe, we will not discuss about the test of the availability of the Web App, we will just work on the output render.
Let’s get started!
Getting ready
To add the output
, in the same Terraform configuration as before, we add the following configuration:
output "webapps_hostnames" {
value= azurerm_linux_web_app.app.default_hostname
}
The source code of this recipe is available here: https://github.com/PacktPublishing/Terraform-Cookbook-Second-Edition/tree/main/CHAP15/outputs
In this Terraform configuration, we run the terraform...