-
Notifications
You must be signed in to change notification settings - Fork 150
/
Copy pathmain.tf
37 lines (30 loc) · 890 Bytes
/
main.tf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
resource "random_string" "naming" {
special = false
upper = false
length = 6
}
data "azurerm_client_config" "current" {
}
data "external" "me" {
program = ["az", "account", "show", "--query", "user"]
}
locals {
prefix = join("-", ["tfdemo", "${random_string.naming.result}"])
dbfsname = join("", ["dbfs", "${random_string.naming.result}"]) // dbfs name must not have special chars
// tags that are propagated down to all resources
tags = {
Environment = "Testing"
Owner = lookup(data.external.me.result, "name")
Epoch = random_string.naming.result
}
}
resource "azurerm_resource_group" "dp_rg" {
name = "adb-dp-${local.prefix}-rg"
location = var.location
tags = local.tags
}
resource "azurerm_resource_group" "transit_rg" {
name = "adb-transit-${local.prefix}-rg"
location = var.location
tags = local.tags
}