2
2
3
3
## Introduction
4
4
5
- This module manages resources for Azure DB for MySQL.
5
+ This module manages resources for Azure DB for MySQL using the flexible server deployment.
6
+
7
+ More details are available in the following sources:
8
+
9
+ - [ Terraform AzureRM provider flexible server resource type] ( https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/mysql_flexible_server )
10
+ - [ Microsoft flexible server documentation] ( https://learn.microsoft.com/en-us/azure/mysql/flexible-server/ )
6
11
7
12
## Usage
8
13
@@ -34,11 +39,12 @@ No modules.
34
39
35
40
The following resources are used by this module:
36
41
37
- - [ azurerm_mysql_database.db] ( https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/mysql_database ) (resource)
38
- - [ azurerm_mysql_firewall_rule.firewall] ( https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/mysql_firewall_rule ) (resource)
39
- - [ azurerm_mysql_server.server] ( https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/mysql_server ) (resource)
40
- - [ azurerm_mysql_virtual_network_rule.virtualnetworks] ( https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/mysql_virtual_network_rule ) (resource)
41
- - [ azurerm_private_endpoint.mysql-private-endpoint] ( https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/private_endpoint ) (resource)
42
+ - [ azurerm_mysql_flexible_database.db] ( https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/mysql_flexible_database ) (resource)
43
+ - [ azurerm_mysql_flexible_server.server] ( https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/mysql_flexible_server ) (resource)
44
+ - [ azurerm_mysql_flexible_server_configuration.configuration] ( https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/mysql_flexible_server_configuration ) (resource)
45
+ - [ azurerm_mysql_flexible_server_configuration.require-secure-transport] ( https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/mysql_flexible_server_configuration ) (resource)
46
+ - [ azurerm_mysql_flexible_server_configuration.tls-version] ( https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/mysql_flexible_server_configuration ) (resource)
47
+ - [ azurerm_mysql_flexible_server_firewall_rule.firewall] ( https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/mysql_flexible_server_firewall_rule ) (resource)
42
48
43
49
## Required Inputs
44
50
@@ -52,14 +58,13 @@ Type: `string`
52
58
53
59
### charset
54
60
55
- Description: Charset for the databases, which needs to be a valid PostgreSQL charset
61
+ Description: Charset for the databases, which needs to be a valid MySQL charset
56
62
57
63
Type: ` string `
58
64
59
65
### collation
60
66
61
- Description: Collation for the databases, which needs to be a valid PostgreSQL collation. Note that Microsoft uses
62
- different notation - f.e. en-US instead of en\_ US
67
+ Description: Charset for the databases, which needs to be a valid MySQL charset
63
68
64
69
Type: ` string `
65
70
@@ -122,6 +127,14 @@ map(object({
122
127
123
128
Default: ` {} `
124
129
130
+ ### availability\_ zone
131
+
132
+ Description: The availability zone the server will be created in
133
+
134
+ Type: ` string `
135
+
136
+ Default: ` "1" `
137
+
125
138
### backup\_ retention\_ days
126
139
127
140
Description: Number of days to keep backups
@@ -130,48 +143,89 @@ Type: `number`
130
143
131
144
Default: ` 7 `
132
145
146
+ ### configurations
147
+
148
+ Description: Additional MySQL configurations
149
+
150
+ Type: ` map(string) `
151
+
152
+ Default: ` {} `
153
+
133
154
### database\_ host\_ sku
134
155
135
156
Description: SKU for the database server to use
136
157
137
158
Type: ` string `
138
159
139
- Default: ` "GP_Gen5_2" `
160
+ Default: ` "GP_Standard_D4ds_v4" `
161
+
162
+ ### database\_ storage\_ autogrow
163
+
164
+ Description: Autogrow storage when limit is reached?
165
+
166
+ Type: ` bool `
140
167
141
- ### database \_ storage
168
+ Default: ` true `
142
169
143
- Description: Required database storage (in MB)
170
+ ### database\_ storage\_ iops
171
+
172
+ Description: IO operations per second
173
+
174
+ Type: ` number `
175
+
176
+ Default: ` 3600 `
177
+
178
+ ### database\_ storage\_ size
179
+
180
+ Description: Required database storage (in GB)
144
181
145
182
Type: ` string `
146
183
147
- Default: ` "5120 " `
184
+ Default: ` "20 " `
148
185
149
186
### database\_ version
150
187
151
188
Description: Database version to use
152
189
153
190
Type: ` string `
154
191
155
- Default: ` "8.0" `
192
+ Default: ` "8.0.21" `
193
+
194
+ ### delegated\_ subnet\_ id
195
+
196
+ Description: The id of a subnet that the server will be created in if private-only access is required.
197
+ This subnet requires a service delegation definition like this:
198
+ ``` hcl
199
+ delegation {
200
+ name = "fs"
201
+ service_delegation {
202
+ name = "Microsoft.DBforMySQL/flexibleServers"
203
+ actions = [
204
+ "Microsoft.Network/virtualNetworks/subnets/join/action",
205
+ ]
206
+ }
207
+ }
208
+ ```
209
+
210
+ Type: ` string `
211
+
212
+ Default: ` null `
156
213
157
- ### public \_ access
214
+ ### geo \_ redundant \_ backup \_ enabled
158
215
159
- Description: Wether to allow public access to the database server. True will create firewall rules for allowed\_ ips and for subnets. False will
160
- create a private endpoint in each given subnet (allowed\_ ips will not be used then) - you have to set
161
- enforce\_ private\_ link\_ endpoint\_ network\_ policies = true on your subnet in this case (see
162
- https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/subnet#enforce_private_link_endpoint_network_policies ).
216
+ Description: Whether backups should be geo redundant
163
217
164
218
Type: ` bool `
165
219
166
220
Default: ` false `
167
221
168
- ### subnets
222
+ ### private \_ dns \_ zone \_ id
169
223
170
- Description: Maps of prefix => subnet id that has access to the server
224
+ Description: The id of the private dns zone when using private-only access
171
225
172
- Type: ` map( string) `
226
+ Type: ` string `
173
227
174
- Default: ` {} `
228
+ Default: ` null `
175
229
176
230
### suffix
177
231
0 commit comments