generated from Azure/terraform-azurerm-avm-template
-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathvariables.tf
168 lines (148 loc) · 6.35 KB
/
variables.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
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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
variable "location" {
type = string
description = <<DESCRIPTION
Azure region where the resource should be deployed.
If null, the location will be inferred from the resource group location.
Changing this forces a new resource to be created.
Example Inputs: eastus
See more in CLI: az account list-locations -o table --query "[].name"
DESCRIPTION
nullable = false
}
variable "name" {
type = string
description = <<DESCRIPTION
Specifies the name of the ServiceBus Namespace resource.
Changing this forces a new resource to be created.
Name must only contain letters, numbers, and hyphens and be between 6 and 50 characteres long. Also, it must not start or end with a hyphen.
Example Inputs: sb-sharepoint-prod-westus-001
See more: https://learn.microsoft.com/en-us/azure/azure-resource-manager/management/resource-name-rules#microsoftservicebus
DESCRIPTION
nullable = false
validation {
condition = can(regex("^[a-zA-Z0-9-]+$", var.name))
error_message = "The 'name' variable must only contain letters, numbers, and hyphens."
}
validation {
condition = length(var.name) <= 50 && length(var.name) >= 6
error_message = "The 'name' variable must be between 6 and 50 characters long"
}
validation {
condition = substr(var.name, 0, 1) != "-" && substr(var.name, length(var.name) - 1, 1) != "-"
error_message = "The 'name' variable must not start or end with a hyphen."
}
}
variable "resource_group_name" {
type = string
description = <<DESCRIPTION
The name of the resource group in which to create this resource.
Changing this forces a new resource to be created.
Name must be less than 90 characters long and must only contain underscores, hyphens, periods, parentheses, letters, or digits.
Example Inputs: rg-sharepoint-prod-westus-001
See more: https://learn.microsoft.com/en-us/azure/azure-resource-manager/management/resource-name-rules#microsoftresources
DESCRIPTION
nullable = false
validation {
condition = length(var.resource_group_name) <= 90
error_message = "The 'resource_group_name' variable must be less than 90 characters long."
}
validation {
condition = can(regex("^[().a-zA-Z0-9_-]+$", var.resource_group_name))
error_message = "The 'resource_group_name' variable must only contain underscores, hyphens, periods, parentheses, letters, or digits."
}
}
variable "authorization_rules" {
type = map(object({
name = optional(string, null)
send = optional(bool, false)
listen = optional(bool, false)
manage = optional(bool, false)
}))
default = {}
description = <<DESCRIPTION
Defaults to `{}`. Manages a ServiceBus Namespace authorization Rule within a ServiceBus.
- `name` - (Optional) - Defaults to `null`. Specifies the name of the ServiceBus Namespace Authorization Rule resource. Changing this forces a new resource to be created. If it is null it will use the map key as the name.
- `send` - (Optional) - Always set to `true` when manage is `true` if not it will default to `false`. Does this Authorization Rule have Listen permissions to the ServiceBus Namespace?
- `listen` - (Optional) - Always set to `true` when manage is `true` if not it will default to `false`. Does this Authorization Rule have Send permissions to the ServiceBus Namespace?
- `manage` - (Optional) - Defaults to `false`. Does this Authorization Rule have Manage permissions to the ServiceBus Namespace?
Example Inputs:
```hcl
authorization_rules = {
testRule = {
send = true
listen = true
manage = true
}
}
```
DESCRIPTION
nullable = false
}
variable "capacity" {
type = number
default = null
description = <<DESCRIPTION
Always set to `0` for Standard and Basic. Defaults to `1` for Premium. Specifies the capacity.
When sku is Premium, capacity can be 1, 2, 4, 8 or 16.
DESCRIPTION
validation {
condition = var.capacity == null || can(index([1, 2, 4, 8, 16], var.capacity))
error_message = "The 'capacity' variable must be 1, 2, 4, 8, or 16 when 'sku' is 'Premium'."
}
}
variable "local_auth_enabled" {
type = bool
default = true
description = "Defaults to `true`. Whether or not SAS authentication is enabled for the Service Bus namespace."
nullable = false
}
variable "minimum_tls_version" {
type = string
default = "1.2"
description = "Defaults to `1.2`. The minimum supported TLS version for this Service Bus Namespace. Valid values are: 1.0, 1.1 and 1.2."
nullable = false
validation {
condition = var.minimum_tls_version == null || can(index(["1.0", "1.1", "1.2"], var.minimum_tls_version))
error_message = "The 'minimum_tls_version' variable must be '1.0', '1.1' or '1.2'."
}
}
variable "premium_messaging_partitions" {
type = number
default = null
description = <<DESCRIPTION
Always set to `0` for Standard and Basic. Defaults to `1` for Premium. Specifies the number of messaging partitions.
Possible values when Premium are 1, 2, and 4. Changing this forces a new resource to be created.
DESCRIPTION
validation {
condition = var.premium_messaging_partitions == null || can(index([1, 2, 4], var.premium_messaging_partitions))
error_message = "The 'premium_messaging_partitions' variable must be 1, 2, or 4 when 'sku' is 'Premium'."
}
}
variable "sku" {
type = string
default = "Premium"
description = <<DESCRIPTION
Defaults to `Premium`. Defines which tier to use. Options are Basic, Standard or Premium.
Please note that setting this field to Premium will force the creation of a new resource.
DESCRIPTION
nullable = false
validation {
condition = contains(["Basic", "Standard", "Premium"], var.sku)
error_message = "The 'sku' variable must be either 'Basic', 'Standard', or 'Premium'."
}
}
variable "timeouts" {
type = object({
create = optional(string)
delete = optional(string)
read = optional(string)
update = optional(string)
})
default = null
description = <<-EOT
- `create` - (Defaults to 30 minutes) Used when creating the ServiceBus Namespace.
- `delete` - (Defaults to 30 minutes) Used when deleting the ServiceBus Namespace.
- `read` - (Defaults to 5 minutes) Used when retrieving the ServiceBus Namespace.
- `update` - (Defaults to 30 minutes) Used when updating the ServiceBus Namespace.
EOT
}