© Copyright 2024, Intel Corporation
This module can be used to deploy an Intel optimized Azure MySQL Flexible Server instance. Instance selection and mysql optimization are included by default in the code.
The MySQL Optimizations were based off Intel Xeon Tuning guides
Handle up to 35% More MySQL New Orders per Minute with 3rd Gen Intel® Xeon® Scalable Processors(Ice Lake)
Boost Azure MySQL performance by 30% with the Ev5 Intel 3rd Generation Intel® Xeon® Scalable Processor (Ice Lake)
See examples folder for complete examples.
By default, you will only have to pass three variables
resource_group_name
db_server_name
db_password
variables.tf
variable "db_password" {
description = "Password for the master database user."
type = string
sensitive = true
}
main.tf
module "optimized-mysql-server" {
source = "intel/azure-mysql-flexible-server/intel"
resource_group_name = "<RESOURCE_GROUP_NAME>"
db_server_name = "<DB_SERVER_NAME>"
db_password = var.db_password
}
Run Terraform
export TF_VAR_db_password ='<USE_A_STRONG_PASSWORD>'
terraform init
terraform plan
terraform apply
Note that this example creates resources. Run terraform destroy
when you don't need these resources.
Name | Version |
---|---|
terraform | >=1.3.0 |
azurerm | ~>3.86 |
Name | Version |
---|---|
azurerm | ~>3.86 |
No modules.
Name | Type |
---|---|
azurerm_mysql_flexible_database.mysql | resource |
azurerm_mysql_flexible_server.mysql | resource |
azurerm_mysql_flexible_server_configuration.mysql | resource |
azurerm_mysql_flexible_server_firewall_rule.firewall | resource |
azurerm_resource_group.rg | data source |
Name | Description | Type | Default | Required |
---|---|---|---|---|
db_allocated_storage | Maximum allocated storage for Azure database instance to grow (in gigabytes). | number |
2048 |
no |
db_auto_grow_enabled | Enable/Disable auto-growing of the storage. Storage auto-grow prevents your server from running out of storage and becoming read-only. | bool |
true |
no |
db_backup_retention_period | The days to retain backups for. Must be between 1 and 35. | number |
7 |
no |
db_charset | Specifies the Charset for the MySQL Database. | string |
"utf8" |
no |
db_collation | Specifies the Collation for the MySQL Database. | string |
"utf8_general_ci" |
no |
db_create_mode | The creation mode which can be used to restore or replicate existing servers. | string |
"Default" |
no |
db_create_source_id | For creation modes other than Default, the source server ID to use. | string |
null |
no |
db_delegated_subnet_id | The ID of the virtual network subnet to create the MySQL Flexible Server. | string |
null |
no |
db_engine | Database engine for Azure database instance. | string |
"mysql" |
no |
db_engine_version | Database engine version for the Azure database instance. | string |
"8.0.21" |
no |
db_firewall_rules | Map of IP ranges that (if specified) will create firewall rules for the MySQL server to access those addresses. | list(object({ |
[] |
no |
db_geo_backup_enabled | Turn Geo-redundant server backups on/off. This allows you to choose between locally redundant or geo-redundant backup storage in the General Purpose and Memory Optimized tiers. When the backups are stored in geo-redundant backup storage, they are not only stored within the region in which your server is hosted, but are also replicated to a paired data center. This provides better protection and ability to restore your server in a different region in the event of a disaster | bool |
false |
no |
db_ha_mode | The high availability mode for the MySQL Flexible Server. Possibles values are SameZone and ZoneRedundant. | string |
"ZoneRedundant" |
no |
db_ha_standby_zone | Specifies the Availability Zone in which the standby Flexible Server should be located. Possible values are 1, 2 and 3. | string |
2 |
no |
db_iops | The amount of provisioned IOPS. | number |
10000 |
no |
db_maintenance_day | The day of week for maintenance window. | string |
null |
no |
db_maintenance_hour | The start hour for maintenance window. | string |
null |
no |
db_maintenance_minute | The start minute for maintenance window. | string |
null |
no |
db_name | Name of the database that will be created on the flexible instance. If this is specified then a database will be created as a part of the instance provisioning process. | string |
null |
no |
db_parameters | Intel Cloud optimizations for Xeon processors | object({ |
{ |
no |
db_password | Password for the master database user. | string |
n/a | yes |
db_private_dns_zone_id | The ID of the private DNS zone to create the MySQL Flexible Server. | string |
null |
no |
db_replica_role | The replica role that the database will use. | string |
null |
no |
db_restore_time | When create_mode is PointInTimeRestore, specifies the point in time to restore from creation_source_server_id. It should be provided in RFC3339 format, e.g. 2013-11-08T22:00:40Z. | string |
null |
no |
db_server_name | Name of the server that will be created. | string |
n/a | yes |
db_server_sku | Instance SKU, see comments above for guidance | string |
"MO_Standard_E8ds_v5" |
no |
db_timeouts | Map of timeouts that can be adjusted when executing the module. This allows you to customize how long certain operations are allowed to take before being considered to have failed. | object({ |
{ |
no |
db_username | Username for the master database user. | string |
"mysqladmin" |
no |
db_zone | Specifies the Availability Zone in which this MySQL Flexible Server should be located. Possible values are 1, 2 and 3. | string |
1 |
no |
resource_group_name | Resource Group where resource will be created. It should already exist | string |
n/a | yes |
tags | Tags to apply to the Database Server | map(string) |
{} |
no |
Name | Description |
---|---|
db_allocated_storage | Storage allocated to the database instance. |
db_auto_grow_enabled | Flag that determines if storage auto grow is enabled. |
db_backup_retention | Number of configured backups to keep for the database instance. |
db_charset | The Charset configured on the database. |
db_collation | The Collation configured on the database. |
db_create_mode | The creation mode that was configured on the instance. |
db_create_source_id | For creation modes other than Default, the source server ID to use. |
db_delegated_subnet_id | The ID of the virtual network subnet to create the MySQL Flexible Server. |
db_engine_version_actual | Running engine version of the database (full version number). |
db_firewall_rules | Database Firewall Rules. |
db_ha_mode | The high availability mode for the MySQL Flexible Server. |
db_ha_standby_zone | Specifies the Availability Zone in which the standby Flexible Server should be located. |
db_hostname | Database instance fully qualified domain name. |
db_id | Database instance ID. |
db_iops | Database instance storage iops configuration. |
db_location | Database instance location. |
db_maintenance_window_day | Maintenance window for the database instance. |
db_maintenance_window_hour | Maintenance window for the database instance. |
db_maintenance_window_minute | Maintenance window for the database instance. |
db_name | Name of the database that has been provisioned on the database instance. |
db_password | Database instance master password. |
db_private_dns_zone_id | The ID of the private DNS zone that the instance will use. |
db_replica_role | The replica role that the database was configured with. |
db_resource_group_name | Resource Group where the database instance resides. |
db_restore_time | Specifies the point in time to restore from creation_source_server_id. |
db_server_name | Database instance hostname. |
db_server_sku | Instance SKU in use for the database instance that was created. |
db_username | Database instance master username. |
db_zone | Zone where the database instance was deployed. |