forked from databricks/terraform-databricks-examples
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.tf
20 lines (17 loc) · 738 Bytes
/
main.tf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
resource "azurerm_resource_group" "this" {
count = var.create_resource_group ? 1 : 0
name = var.spoke_resource_group_name
location = var.location
tags = var.tags
}
data "azurerm_resource_group" "this" {
count = var.create_resource_group ? 0 : 1
name = var.spoke_resource_group_name
}
locals {
rg_name = var.create_resource_group ? azurerm_resource_group.this[0].name : data.azurerm_resource_group.this[0].name
rg_id = var.create_resource_group ? azurerm_resource_group.this[0].id : data.azurerm_resource_group.this[0].id
rg_location = var.create_resource_group ? azurerm_resource_group.this[0].location : data.azurerm_resource_group.this[0].location
}
data "azurerm_client_config" "current" {
}