-
Notifications
You must be signed in to change notification settings - Fork 97
Expand file tree
/
Copy pathvariables.tf
More file actions
63 lines (51 loc) · 1.84 KB
/
Copy pathvariables.tf
File metadata and controls
63 lines (51 loc) · 1.84 KB
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
variable "name" {
type = string
description = "Base name of your workspace that will be used in resource names. Please use lowercase with dashes."
validation {
condition = length(var.name) < 24
error_message = "Name must be less than 20 characters."
}
}
variable "location" {
type = string
description = "Azure Region for resources. Defaults to Europe West."
default = "westeurope"
}
variable "devs_group_id" {
description = "AAD Group ID to receive 'Contributor' permissions"
type = string
}
variable "admins_group_id" {
description = "AAD Group ID to receive 'Owner' permissions"
type = string
}
variable "superadmins_group_id" {
type = string
description = "Required: object ID of the AAD group for super admins, used to apply key vault access policies."
}
variable "service_principal_id" {
type = string
description = "Required: Service Principal ID for build agent for this Resource Group to receive 'Contributor' permissions."
}
variable "client_tenant_id" {
description = "AAD Tenant ID for Azure Resource Manager (ARM) client. Defaults to current session."
type = string
default = ""
}
variable "client_object_id" {
description = "Object ID for Azure Resource Manager (ARM) client. Defaults to current session."
type = string
default = ""
}
variable "tags" {
description = "Tags to apply to Azure Resources"
type = map(string)
}
data "azurerm_client_config" "current" {}
# Variables - Normalized
locals {
name = lower(var.name)
name_squished = replace(local.name, "-", "")
client_tenant_id = var.client_tenant_id == "" ? data.azurerm_client_config.current.tenant_id : var.client_tenant_id
client_object_id = var.client_object_id == "" ? data.azurerm_client_config.current.object_id : var.client_object_id
}