THE DEV BENCH
🌍 HCL (Terraform)hard

5. An Azure resource group + subnet reference

Write TWO blocks: 1. resource "azurerm_resource_group" "main" — name = "rg-demo", location = "eastus" 2. resource "azurerm_subnet" "web" — name = "web", and resource_group_name set to REFERENCE the group above: azurerm_resource_group.main.name (a bare reference, NOT a quoted string)

How to approach this

This is real Terraform: resources refer to each other. `resource_group_name = azurerm_resource_group.main.name` is a REFERENCE — you write the address bare (no quotes), and Terraform wires up the dependency and fills in the value at apply time. Quoting it would turn it into the literal text, breaking the link. (For interpolation inside a string you'd use "${…}".)

main.tf