In step 1, we create the moduledemo directory, which will contain the code for all modules with one subdirectory per module. So, we create a WebApp subdirectory for our recipe, which will contain the Terraform configuration of the webapp module. Then in steps 2, 3, and 4, we create the module code, which is the standard Terraform configuration and contains the following files:
- main.tf: This file contains the code of the resources that will be provided by the module.
- variables.tf: This file contains the input variables needed by the module.
- outputs.tf: This file contains the outputs of the module that can be used in the main Terraform configuration.
In step 5, we created the directory that will contain the Terraform configuration of our application. Finally, in step 6, we created the Terraform configuration of our application with the main.tf file.
In the code of this file, we have three Terraform elements:
- There is the Terraform azurerm_resource_group...