Declare Terraform Variable

108 Views Asked by At

Cloud Provider : Azure Can I declare resource group , Virtual network , or subnets in Azure as terraform Variable - Infrastructure as code

without variable :-

resource "azurerm_resource_group" "example" {
name     = "example"
location = var.location
}
1

There are 1 best solutions below

0
On BEST ANSWER

Yes you can

resource "azurerm_resource_group" "example" {
name     = "${var.prefix}-resources"
location = "westeurope"
}