An open API service indexing awesome lists of open source software.

https://github.com/blackbird-cloud/terraform-azurerm-mysql-server

Terraform module to create an Azure MySQL Server
https://github.com/blackbird-cloud/terraform-azurerm-mysql-server

azure mysql terraform

Last synced: about 2 months ago
JSON representation

Terraform module to create an Azure MySQL Server

Awesome Lists containing this project

README

          

# Terraform Azurerm Mysql Server Module
Terraform module to create an Azure MySQL Server

[![blackbird-logo](https://raw.githubusercontent.com/blackbird-cloud/terraform-module-template/main/.config/logo_simple.png)](https://blackbird.cloud)

## Example
```hcl
locals {
network = {
vnet_id = "vnet-123"
subnet_id = "subnet-456"
}
}

module "mysql_server" {
source = "blackbird-cloud/mysql-server/azurerm"
version = "~> 1"

resource_group_name = "myresourcegroup"
resource_group_location = "westeurope"

vnet_id = local.network.vnet_id
subnet_id = local.network.subnet_id

sku = "GP_Standard_D2ds_v4"

name = "mysqlserver"

maintenance_window = {
day_of_week = 0
start_hour = 8
start_minute = 0
}

storage = {
iops = 360
size_gb = 20
}
}
```

## Requirements

| Name | Version |
|------|---------|
| [terraform](#requirement\_terraform) | >= 1.2 |
| [azurerm](#requirement\_azurerm) | ~>3 |
| [random](#requirement\_random) | ~>3 |

## Providers

| Name | Version |
|------|---------|
| [azurerm](#provider\_azurerm) | ~>3 |
| [random](#provider\_random) | ~>3 |

## Resources

| Name | Type |
|------|------|
| [azurerm_mysql_flexible_database.main](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/mysql_flexible_database) | resource |
| [azurerm_mysql_flexible_server.default](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/mysql_flexible_server) | resource |
| [azurerm_private_dns_zone.default](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/private_dns_zone) | resource |
| [azurerm_private_dns_zone_virtual_network_link.default](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/private_dns_zone_virtual_network_link) | resource |
| [random_password.password](https://registry.terraform.io/providers/hashicorp/random/latest/docs/resources/password) | resource |
| [random_string.name](https://registry.terraform.io/providers/hashicorp/random/latest/docs/resources/string) | resource |

## Inputs

| Name | Description | Type | Default | Required |
|------|-------------|------|---------|:--------:|
| [high\_availablity](#input\_high\_availablity) | (Optional) The high availability zone for the MySQL server. | `string` | `"SameZone"` | no |
| [maintenance\_window](#input\_maintenance\_window) | (Optional) The maintenance window for the MySQL server. |

object({
day_of_week = number
start_hour = number
start_minute = number
})
|
{
"day_of_week": 0,
"start_hour": 8,
"start_minute": 0
}
| no |
| [mysql\_version](#input\_mysql\_version) | (Optional) The version of the MySQL server. | `string` | `"8.0.21"` | no |
| [name](#input\_name) | (Optional) The name of the MySQL server. | `string` | `""` | no |
| [resource\_group\_location](#input\_resource\_group\_location) | (Required) Location of the resource group. | `string` | `"westeurope"` | no |
| [resource\_group\_name](#input\_resource\_group\_name) | (Required) The name of the resource group in which to create the MySQL server. | `string` | n/a | yes |
| [sku](#input\_sku) | (Optional) The SKU name for the MySQL server. | `string` | `"GP_Standard_D2ds_v4"` | no |
| [storage](#input\_storage) | (Optional) The storage configuration for the MySQL server. |
object({
auto_grow_enabled = optional(bool)
io_scaling_enabled = optional(bool)
iops = optional(number)
size_gb = optional(number)
})
|
{
"auto_grow_enabled": true,
"io_scaling_enabled": false,
"iops": 360,
"size_gb": 20
}
| no |
| [subnet\_id](#input\_subnet\_id) | (Required) The ID of the subnet where the MySQL server should be deployed. | `string` | n/a | yes |
| [vnet\_id](#input\_vnet\_id) | (Required)The ID of the virtual network where the MySQL server should be deployed. | `string` | n/a | yes |

## Outputs

| Name | Description |
|------|-------------|
| [admin\_login](#output\_admin\_login) | The admin username for the MySQL server. |
| [admin\_password](#output\_admin\_password) | The admin password for the MySQL server. |
| [azurerm\_mysql\_flexible\_server](#output\_azurerm\_mysql\_flexible\_server) | The name of the MySQL Flexible Server. |
| [mysql\_flexible\_server\_database\_name](#output\_mysql\_flexible\_server\_database\_name) | The name of the MySQL Flexible Server Database. |

## About

We are [Blackbird Cloud](https://blackbird.cloud), Amsterdam based cloud consultancy, and cloud management service provider. We help companies build secure, cost efficient, and scale-able solutions.

Checkout our other :point\_right: [terraform modules](https://registry.terraform.io/namespaces/blackbird-cloud)

## Copyright

Copyright © 2017-2024 [Blackbird Cloud](https://blackbird.cloud)