Sets a MySQL Configuration value on a MySQL Server.
provider "azurerm" {
features {}
}
resource "azurerm_resource_group" "example" {
name = "example-resources"
location = "West Europe"
}
resource "azurerm_mysql_server" "example" {
name = "example-mysqlserver"
location = azurerm_resource_group.example.location
resource_group_name = azurerm_resource_group.example.name
administrator_login = "mysqladminun"
administrator_login_password = "H@Sh1CoR3!"
sku_name = "B_Gen5_2"
storage_mb = 5120
version = "5.7"
auto_grow_enabled = true
backup_retention_days = 7
geo_redundant_backup_enabled = true
infrastructure_encryption_enabled = true
public_network_access_enabled = false
ssl_enforcement_enabled = true
ssl_minimal_tls_version_enforced = "TLS1_2"
}
resource "azurerm_mysql_configuration" "example" {
name = "interactive_timeout"
resource_group_name = azurerm_resource_group.example.name
server_name = azurerm_mysql_server.example.name
value = "600"
}
The following arguments are supported:
name
- (Required) Specifies the name of the MySQL Configuration, which needs to be a valid MySQL configuration name. Changing this forces a new resource to be created.
server_name
- (Required) Specifies the name of the MySQL Server. Changing this forces a new resource to be created.
resource_group_name
- (Required) The name of the resource group in which the MySQL Server exists. Changing this forces a new resource to be created.
value
- (Required) Specifies the value of the MySQL Configuration. See the MySQL documentation for valid values. Changing this forces a new resource to be created.
In addition to the Arguments listed above - the following Attributes are exported:
id
- The ID of the MySQL Configuration.The timeouts
block allows you to specify timeouts for certain actions:
create
- (Defaults to 30 minutes) Used when creating the MySQL Configuration.read
- (Defaults to 5 minutes) Used when retrieving the MySQL Configuration.delete
- (Defaults to 30 minutes) Used when deleting the MySQL Configuration.MySQL Configurations can be imported using the resource id
, e.g.
terraform import azurerm_mysql_configuration.interactive_timeout /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/mygroup1/providers/Microsoft.DBforMySQL/servers/server1/configurations/interactive_timeout