22
33## Introduction
44
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/ )
611
712## Usage
813
@@ -34,11 +39,12 @@ No modules.
3439
3540The following resources are used by this module:
3641
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)
4248
4349## Required Inputs
4450
@@ -52,14 +58,13 @@ Type: `string`
5258
5359### charset
5460
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
5662
5763Type: ` string `
5864
5965### collation
6066
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
6368
6469Type: ` string `
6570
@@ -122,6 +127,14 @@ map(object({
122127
123128Default: ` {} `
124129
130+ ### availability\_ zone
131+
132+ Description: The availability zone the server will be created in
133+
134+ Type: ` string `
135+
136+ Default: ` "1" `
137+
125138### backup\_ retention\_ days
126139
127140Description: Number of days to keep backups
@@ -130,48 +143,89 @@ Type: `number`
130143
131144Default: ` 7 `
132145
146+ ### configurations
147+
148+ Description: Additional MySQL configurations
149+
150+ Type: ` map(string) `
151+
152+ Default: ` {} `
153+
133154### database\_ host\_ sku
134155
135156Description: SKU for the database server to use
136157
137158Type: ` string `
138159
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 `
140167
141- ### database \_ storage
168+ Default: ` true `
142169
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)
144181
145182Type: ` string `
146183
147- Default: ` "5120 " `
184+ Default: ` "20 " `
148185
149186### database\_ version
150187
151188Description: Database version to use
152189
153190Type: ` string `
154191
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 `
156213
157- ### public \_ access
214+ ### geo \_ redundant \_ backup \_ enabled
158215
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
163217
164218Type: ` bool `
165219
166220Default: ` false `
167221
168- ### subnets
222+ ### private \_ dns \_ zone \_ id
169223
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
171225
172- Type: ` map( string) `
226+ Type: ` string `
173227
174- Default: ` {} `
228+ Default: ` null `
175229
176230### suffix
177231
0 commit comments