This module manages resources for Azure DB for MySQL using the flexible server deployment.
More details are available in the following sources:
Instantiate the module by calling it from Terraform like this:
module "azure-mysql" {
source = "dodevops/mysql/azure"
version = "<version>"
}
The following requirements are needed by this module:
-
terraform (>=1.0.0)
-
azurerm (>=3.63.0)
The following providers are used by this module:
- azurerm (>=3.63.0)
No modules.
The following resources are used by this module:
- azurerm_mysql_flexible_database.db (resource)
- azurerm_mysql_flexible_server.server (resource)
- azurerm_mysql_flexible_server_configuration.configuration (resource)
- azurerm_mysql_flexible_server_configuration.require-secure-transport (resource)
- azurerm_mysql_flexible_server_configuration.tls-version (resource)
- azurerm_mysql_flexible_server_firewall_rule.firewall (resource)
The following input variables are required:
Description: Admin password
Type: string
Description: Charset for the databases, which needs to be a valid MySQL charset
Type: string
Description: Charset for the databases, which needs to be a valid MySQL charset
Type: string
Description: List of suffixes for databases to be created
Type: list(string)
Description: The azure location used for azure
Type: string
Description: Three letter project key
Type: string
Description: Azure Resource Group to use
Type: string
Description: Stage for this ressource group
Type: string
The following input variables are optional (have default values):
Description: Admin login
Type: string
Default: "mysqladmin"
Description: 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
Type:
map(object({
start = string,
end = string
}))
Default: {}
Description: The availability zone the server will be created in
Type: string
Default: "1"
Description: Number of days to keep backups
Type: number
Default: 7
Description: Additional MySQL configurations
Type: map(string)
Default: {}
Description: SKU for the database server to use
Type: string
Default: "GP_Standard_D4ds_v4"
Description: Autogrow storage when limit is reached?
Type: bool
Default: true
Description: IO operations per second
Type: number
Default: 3600
Description: Required database storage (in GB)
Type: string
Default: "20"
Description: Database version to use
Type: string
Default: "8.0.21"
Description: 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:
delegation {
name = "fs"
service_delegation {
name = "Microsoft.DBforMySQL/flexibleServers"
actions = [
"Microsoft.Network/virtualNetworks/subnets/join/action",
]
}
}
Type: string
Default: null
Description: Whether backups should be geo redundant
Type: bool
Default: false
Description: The id of the private dns zone when using private-only access
Type: string
Default: null
Description: Naming suffix to allow multiple instances of this module
Type: string
Default: ""
The following outputs are exported:
Description: n/a
Description: n/a
Description: n/a
Description: FQDN of the database service
Use the terraform module tools to check and generate the documentation by running
docker run -v "$PWD":/terraform ghcr.io/dodevops/terraform-module-tools:latest