Skip to content

Commit b10c8ed

Browse files
committed
adding documentation
1 parent ed7ab9a commit b10c8ed

File tree

3 files changed

+85
-11
lines changed

3 files changed

+85
-11
lines changed

README.md

Lines changed: 63 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,10 @@ module "mssql-server" {
2020
source = "kumarvna/mysql-db/azurerm"
2121
version = "1.0.0"
2222
23-
# By default, this module will not create a resource group
24-
# proivde a name to use an existing resource group, specify the existing resource group name,
25-
# and set the argument to `create_resource_group = false`. Location will be same as existing RG.
23+
# By default, this module will create a resource group
24+
# proivde a name to use an existing resource group and set the argument
25+
# to `create_resource_group = false` if you want to existing resoruce group.
26+
# If you use existing resrouce group location will be the same as existing RG.
2627
create_resource_group = false
2728
resource_group_name = "rg-shared-westeurope-01"
2829
location = "westeurope"
@@ -31,7 +32,7 @@ module "mssql-server" {
3132
mysqlserver_name = "roshmysqldbsrv01"
3233
3334
mysqlserver_settings = {
34-
sku_name = "B_Gen5_2"
35+
sku_name = "GP_Gen5_16"
3536
storage_mb = 5120
3637
version = "5.7"
3738
# Database name, charset and collection arguments
@@ -54,10 +55,23 @@ module "mssql-server" {
5455
interactive_timeout = "600"
5556
}
5657
58+
# Use Virtual Network service endpoints and rules for Azure Database for MySQL
59+
subnet_id = var.subnet_id
60+
61+
# The URL to a Key Vault custom managed key
62+
key_vault_key_id = var.key_vault_key_id
63+
64+
# To enable Azure Defender for database set `enable_threat_detection_policy` to true
65+
enable_threat_detection_policy = true
66+
log_retention_days = 30
67+
email_addresses_for_alerts = ["user@example.com", "firstname.lastname@example.com"]
68+
5769
# AD administrator for an Azure SQL server
5870
# Allows you to set a user or group as the AD administrator for an Azure SQL server
5971
ad_admin_login_name = "firstname.lastname@example.com"
6072
73+
74+
6175
# (Optional) To enable Azure Monitoring for Azure MySQL database
6276
# (Optional) Specify `storage_account_name` to save monitoring logs to storage.
6377
log_analytics_workspace_name = "loganalytics-we-sharedtest2"
@@ -84,6 +98,51 @@ module "mssql-server" {
8498
}
8599
```
86100

101+
## Advanced Usage of the Module
102+
103+
### `mysql_setttings` - Setting up your MySQL Server
104+
105+
This object helps you setup desired MySQL server and support following arguments.
106+
107+
| Argument | Description |
108+
|--|--|
109+
`sku_name`|Specifies the SKU Name for this MySQL Server. The name of the SKU, follows the tier + family + cores pattern (e.g. `B_Gen4_1`, `GP_Gen5_8`). Valid values are `B_Gen4_1`, `B_Gen4_2`, `B_Gen5_1`, `B_Gen5_2`, `GP_Gen4_2`, `GP_Gen4_4`, `GP_Gen4_8`, `GP_Gen4_16`, `GP_Gen4_32`, `GP_Gen5_2`, `GP_Gen5_4`, `GP_Gen5_8`, `GP_Gen5_16`, `GP_Gen5_32`, `GP_Gen5_64`, `MO_Gen5_2`, `MO_Gen5_4`, `MO_Gen5_8`, `MO_Gen5_16`, `MO_Gen5_32`.
110+
`storage_mb`|Max storage allowed for a server. Possible values are between `5120` MB(5GB) and `1048576` MB(1TB) for the Basic SKU and between `5120` MB(5GB) and `4194304` MB(4TB) for General Purpose/Memory Optimized SKUs.
111+
`version`|Specifies the version of MySQL to use. Valid values are `5.6`, `5.7`, and `8.0`.
112+
`database_name`|Specifies the name of the MySQL Database, which needs [to be a valid MySQL identifier](https://dev.mysql.com/doc/refman/5.7/en/identifiers.html).
113+
`charset`|Specifies the Charset for the MySQL Database, which needs [to be a valid MySQL Charset](https://dev.mysql.com/doc/refman/5.7/en/charset-charsets.html).
114+
`collation`|Specifies the Collation for the MySQL Database, which needs [to be a valid MySQL Collation](https://dev.mysql.com/doc/refman/5.7/en/charset-mysql.html).
115+
`administrator_login`|The Administrator Login for the MySQL Server. Required when `create_mode` is `Default`.
116+
`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. If storage auto grow is enabled, the storage automatically grows without impacting the workload. The default value if not explicitly specified is `true`
117+
`backup_retention_days`|Backup retention days for the server, supported values are between `7` and `35` days.
118+
`geo_redundant_backup_enabled`|urn 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. This is not supported for the `Basic` tier.
119+
`infrastructure_encryption_enabled`|Whether or not infrastructure is encrypted for this server. Defaults to `false`
120+
`public_network_access_enabled`|Whether or not public network access is allowed for this server. Defaults to `true`.
121+
`ssl_enforcement_enabled`|Specifies if SSL should be enforced on connections. Possible values are `true` and `false`
122+
`ssl_minimal_tls_version_enforced`|The minimum TLS version to support on the sever. Possible values are `TLSEnforcementDisabled`, `TLS1_0`, `TLS1_1`, and `TLS1_2`. Defaults to `TLSEnforcementDisabled`.
123+
124+
### `mysql_configuration` - Configure MySQl Server Parameters
125+
126+
The MySQL server maintains many system variables that configure its operation. Each system variable has a default value. System variables can be set at server startup using options on the command line or in an option file. Most of them can be changed dynamically at runtime using the SET statement, which enables you to modify operation of the server without having to stop and restart it. You can also use system variable values in expressions.
127+
128+
A few Supported parameters are here for your reference. you can find all these `Server Paramter` section in MySQL server. Also check [MySQL website](https://dev.mysql.com/doc/refman/8.0/en/server-options.html) for more details.
129+
130+
| Parameter name | Description | Parameter Type |Default Value
131+
|--|--|--|--|
132+
`audit_log_enabled`|Allow to audit the log. Valid options are `ON` or `OFF`|Dynamic|`OFF`
133+
`connect_timeout`|The number of seconds that the mysqld server waits for a connect packet before responding with Bad handshake|Dynamic|`10`
134+
`innodb_buffer_pool_size`|The size in bytes of the buffer pool, the memory area where InnoDB caches table and index data.Allowed value should be: `134217728`-`65498251264` |Static|`65498251264`
135+
`interactive_timeout`|Number of seconds the server waits for activity on an interactive connection before closing it. Allowed value should be: `1`-`31536000`|Dynamic|`600`
136+
`lock_wait_timeout`|This variable specifies the timeout in seconds for attempts to acquire metadata locks. Allowed value should be: `1`-`31536000`|Dynamic|`31536000`
137+
`max_connections`|The maximum permitted number of simultaneous client connections. Allowed value should be: `10`-`5000`|Dynamic|`2500`
138+
`time_zone`|The server time zone.|Dynamic|`SYSTEM`
139+
140+
### Virtual Network service endpoints and rules
141+
142+
Virtual network rules are one firewall security feature that controls whether your Azure Database for MySQL server accepts communications that are sent from particular subnets in virtual networks.
143+
144+
145+
87146
## Requirements
88147

89148
| Name | Version |

example/complete/README.md

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,10 @@ module "mssql-server" {
99
source = "kumarvna/mysql-db/azurerm"
1010
version = "1.0.0"
1111
12-
# By default, this module will not create a resource group
13-
# proivde a name to use an existing resource group, specify the existing resource group name,
14-
# and set the argument to `create_resource_group = false`. Location will be same as existing RG.
12+
# By default, this module will create a resource group
13+
# proivde a name to use an existing resource group and set the argument
14+
# to `create_resource_group = false` if you want to existing resoruce group.
15+
# If you use existing resrouce group location will be the same as existing RG.
1516
create_resource_group = false
1617
resource_group_name = "rg-shared-westeurope-01"
1718
location = "westeurope"
@@ -20,7 +21,7 @@ module "mssql-server" {
2021
mysqlserver_name = "roshmysqldbsrv01"
2122
2223
mysqlserver_settings = {
23-
sku_name = "B_Gen5_2"
24+
sku_name = "GP_Gen5_16"
2425
storage_mb = 5120
2526
version = "5.7"
2627
# Database name, charset and collection arguments
@@ -43,10 +44,23 @@ module "mssql-server" {
4344
interactive_timeout = "600"
4445
}
4546
47+
# Use Virtual Network service endpoints and rules for Azure Database for MySQL
48+
subnet_id = var.subnet_id
49+
50+
# The URL to a Key Vault custom managed key
51+
key_vault_key_id = var.key_vault_key_id
52+
53+
# To enable Azure Defender for database set `enable_threat_detection_policy` to true
54+
enable_threat_detection_policy = true
55+
log_retention_days = 30
56+
email_addresses_for_alerts = ["user@example.com", "firstname.lastname@example.com"]
57+
4658
# AD administrator for an Azure SQL server
4759
# Allows you to set a user or group as the AD administrator for an Azure SQL server
4860
ad_admin_login_name = "firstname.lastname@example.com"
4961
62+
63+
5064
# (Optional) To enable Azure Monitoring for Azure MySQL database
5165
# (Optional) Specify `storage_account_name` to save monitoring logs to storage.
5266
log_analytics_workspace_name = "loganalytics-we-sharedtest2"

example/complete/main.tf

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,10 @@ module "mssql-server" {
22
// source = "kumarvna/mysql-db/azurerm"
33
// version = "1.0.0"
44
source = "../../"
5-
# By default, this module will not create a resource group
6-
# proivde a name to use an existing resource group, specify the existing resource group name,
7-
# and set the argument to `create_resource_group = false`. Location will be same as existing RG.
5+
# By default, this module will create a resource group
6+
# proivde a name to use an existing resource group and set the argument
7+
# to `create_resource_group = false` if you want to existing resoruce group.
8+
# If you use existing resrouce group location will be the same as existing RG.
89
create_resource_group = false
910
resource_group_name = "rg-shared-westeurope-01"
1011
location = "westeurope"

0 commit comments

Comments
 (0)