-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathvars.tf
150 lines (128 loc) · 3.58 KB
/
vars.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
variable "location" {
type = string
description = "The azure location used for azure"
}
variable "project" {
type = string
description = "Three letter project key"
}
variable "stage" {
type = string
description = "Stage for this ressource group"
}
variable "resource_group" {
type = string
description = "Azure Resource Group to use"
}
variable "database_suffixes" {
type = list(string)
description = "List of suffixes for databases to be created"
}
variable "database_version" {
type = string
description = "Database version to use"
default = "8.0.21"
}
variable "suffix" {
type = string
description = "Naming suffix to allow multiple instances of this module"
default = ""
}
variable "charset" {
type = string
description = "Charset for the databases, which needs to be a valid MySQL charset"
}
variable "collation" {
type = string
description = "Charset for the databases, which needs to be a valid MySQL charset"
}
variable "backup_retention_days" {
type = number
description = "Number of days to keep backups"
default = 7
validation {
condition = var.backup_retention_days >= 7 && var.backup_retention_days <= 35
error_message = "Backup retention days has to be between 7 and 35 including."
}
}
variable "admin_login" {
type = string
description = "Admin login"
default = "mysqladmin"
}
variable "admin_password" {
type = string
description = "Admin password"
}
variable "database_host_sku" {
type = string
default = "GP_Standard_D4ds_v4"
description = "SKU for the database server to use"
}
variable "database_storage_size" {
type = string
default = "20"
description = "Required database storage (in GB)"
}
variable "database_storage_autogrow" {
type = bool
default = true
description = "Autogrow storage when limit is reached?"
}
variable "database_storage_iops" {
type = number
default = 3600
description = "IO operations per second"
}
variable "allowed_ips" {
description = <<EOF
A hash of permissions to access the database server by ip. The hash key is the name suffix and each value
has a start and an end value.
* For public access set start to 0.0.0.0 and end to 255.255.255.255
* To allow access from all Azure services to this database, set start and end to 0.0.0.0
EOF
type = map(object({
start = string,
end = string
}))
default = {}
}
variable "delegated_subnet_id" {
description = <<-EOT
The id of a subnet that the server will be created in if private-only access is required.
This subnet requires a service delegation definition like this:
```hcl
delegation {
name = "fs"
service_delegation {
name = "Microsoft.DBforMySQL/flexibleServers"
actions = [
"Microsoft.Network/virtualNetworks/subnets/join/action",
]
}
}
```
EOT
type = string
default = null
}
variable "private_dns_zone_id" {
description = "The id of the private dns zone when using private-only access"
type = string
default = null
}
variable "geo_redundant_backup_enabled" {
description = "Whether backups should be geo redundant"
type = bool
default = false
}
variable "configurations" {
description = "Additional MySQL configurations"
type = map(string)
default = {}
}
variable "availability_zone" {
description = "The availability zone the server will be created in"
type = string
default = "1"
}