You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# To enable Azure Defender for database set `enable_threat_detection_policy` to true
65
75
enable_threat_detection_policy = true
66
76
log_retention_days = 30
@@ -138,6 +148,8 @@ A few Supported parameters are here for your reference. you can find all these `
138
148
139
149
A virtual network rule for your Azure Database for MySQL server is a subnet that is listed in the access control list (ACL) of your Azure Database for MySQL server. To be in the ACL for your Azure Database for MySQL server, the subnet must contain the **`Microsoft.Sql`** type name. To enable this feature, add a `subnet_id` with valid resource id.
140
150
151
+
>This feature is available in all regions of Azure where Azure Database for MySQL is deployed for General Purpose and Memory Optimized servers. In case of VNet peering, if traffic is flowing through a common VNet Gateway with service endpoints and is supposed to flow to the peer, please create an ACL/VNet rule to allow Azure Virtual Machines in the Gateway VNet to access the Azure Database for MySQL server.
152
+
141
153
### Data Encryption with a Customer-managed Key
142
154
143
155
Data encryption with customer-managed keys for Azure Database for MySQL enables you to bring your own key (BYOK) for data protection at rest. It also allows organizations to implement separation of duties in the management of keys and data.
@@ -146,13 +158,17 @@ Data encryption is set at the server-level. The customer-managed key is an asymm
146
158
147
159
### Server Firewall Rules
148
160
149
-
Firewalls prevent all access to your database server until you specify which computers have permission. To configure a firewall, create firewall rules that specify ranges of acceptable IP addresses. You can create firewall rules at the server level with variable `firewall_rules` with valid IP addresses.
161
+
Firewalls prevent all access to your database server until you specify which computers have permission. To configure a firewall, create firewall rules that specify ranges of acceptable IP addresses.
162
+
163
+
By default, no external access to your MySQL Database will be allowed until you explicitly assign permission by creating a firewall rule. To add the firewall rules to the MySQL database, specify the list of `firewall_rules` with valid IP addresses.
150
164
151
-
### Active Directory Administrator
165
+
### Adding Active Directory Administrator to SQL Database
152
166
153
-
This module supports for Azure Active Directory (Azure AD) integration for Azure Database for MySQL. This integration allows you to securely sign in to their database by using Azure Active Directory and to manage credentials in a central place. For consistent role management, manage database access using Active Directory groups. You can add AD user/group using `ad_admin_login_name` variable.
167
+
Azure Active Directory authentication is a mechanism of connecting to Microsoft Azure database for MySQL by using identities in Azure Active Directory (Azure AD). This module adds the provided Azure Active Directory user/group to MySQL Database as an administrator so that the user can login to this database with Azure AD authentication.
154
168
155
-
> Azure Active Directory authentication is only available for MySQL 5.7 and newer. Only one Azure AD administrator can be configured for a Azure Database for MySQL server at any time. Only an Azure AD administrator for MySQL can initially connect to the Azure Database for MySQL using an Azure Active Directory account.
169
+
By default, this feature not enabled on this module. To add the Active Directory Administrator, set the argument `ad_admin_login_name` with a valid Azure AD user/group login name.
170
+
171
+
>Azure Active Directory authentication is only available for MySQL 5.7 and newer. Only one Azure AD administrator can be configured for a Azure Database for MySQL server at any time. Only an Azure AD administrator for MySQL can initially connect to the Azure Database for MySQL using an Azure Active Directory account.
156
172
157
173
### Threat detection policy AKA Server Security Alerts Policy
158
174
@@ -164,14 +180,30 @@ Advanced Threat Detection for Azure Database for MySQL server detects anomalous
164
180
* Access from a potentially harmful application
165
181
* Brute force login credentials
166
182
167
-
Enable threat detection policy setting up the variables `enable_threat_detection_policy`, `log_retention_days` and `email_addresses_for_alerts` with valid values.
183
+
By default, this feature not enabled on this module. Enable threat detection policy setting up the variables `enable_threat_detection_policy`, `log_retention_days` and `email_addresses_for_alerts` with valid values.
184
+
185
+
>Note: Enabling `threat_detection_policy` features on SQL servers and database going to create a storage account to keep all audit logs. Log retention policy to be configured to keep the size within limits for this storage account. Note that this module creates resources that can cost money.
186
+
187
+
### Private Link to Azure Database for MySQL
188
+
189
+
Azure Private Endpoint is a network interface that connects you privately and securely to a service powered by Azure Private Link. Private Endpoint uses a private IP address from your VNet, effectively bringing the service into your VNet.
190
+
191
+
With Private Link, Microsoft offering the ability to associate a logical server to a specific private IP address (also known as private endpoint) within the VNet. This module helps to implement Failover Groups using private endpoint for SQL Database instead of the public endpoint thus ensuring that customers can get security benefits that it offers.
192
+
193
+
Clients can connect to the Private endpoint from the same VNet, peered VNet in same region, or via VNet-to-VNet connection across regions. Additionally, clients can connect from on-premises using ExpressRoute, private peering, or VPN tunneling.
194
+
195
+
By default, this feature not enabled on this module. To create private link with private endpoints set the variable `enable_private_endpoint` to `true` and provide `virtual_network_name`, `private_subnet_address_prefix` with a valid values. You can also use the existing private DNS zone to create DNS records. To use this feature, set the `existing_private_dns_zone` with a valid existing private DNS zone name.
196
+
197
+
For more details: [Private Link for Azure Database for MySQL](https://docs.microsoft.com/en-us/azure/mysql/concepts-data-access-security-private-link)
198
+
199
+
>The private link feature is only available for Azure Database for MySQL servers in the General Purpose or Memory Optimized pricing tiers. Ensure the database server is in one of these pricing tiers.
168
200
169
201
## Recommended naming and tagging conventions
170
202
171
203
Applying tags to your Azure resources, resource groups, and subscriptions to logically organize them into a taxonomy. Each tag consists of a name and a value pair. For example, you can apply the name `Environment` and the value `Production` to all the resources in production.
172
204
For recommendations on how to implement a tagging strategy, see Resource naming and tagging decision guide.
173
205
174
-
>**Important** :
206
+
>**Important** :
175
207
Tag names are case-insensitive for operations. A tag with a tag name, regardless of the casing, is updated or retrieved. However, the resource provider might keep the casing you provide for the tag name. You'll see that casing in cost reports. **Tag values are case-sensitive.**
176
208
177
209
An effective naming convention assembles resource names by using important resource information as parts of a resource's name. For example, using these [recommended naming conventions](https://docs.microsoft.com/en-us/azure/cloud-adoption-framework/ready/azure-best-practices/naming-and-tagging#example-names), a public IP resource for a production SharePoint workload is named like this: `pip-sharepoint-prod-westus-001`.
@@ -215,6 +247,10 @@ firewall_rules|Range of IP addresses to allow firewall connections|map(object({}
215
247
`ad_admin_login_name`|The login name of the principal to set as the server administrator|string|`null`
216
248
`key_vault_key_id`|The URL to a Key Vault custom managed key|string|`null`
217
249
`extaudit_diag_logs`|Database Monitoring Category details for Azure Diagnostic setting|list(string)|`["MySqlSlowLogs", "MySqlAuditLogs"]`
250
+
`enable_private_endpoint`|Azure Private Endpoint is a network interface that connects you privately and securely to a service powered by Azure Private Link|string|`"false"`
251
+
`virtual_network_name` | The name of the virtual network|string|`""`
252
+
`private_subnet_address_prefix`|A list of subnets address prefixes inside virtual network| list |`[]`
253
+
`existing_private_dns_zone`|Name of the existing private DNS zone|string|`null`
218
254
`Tags` | A map of tags to add to all resources | map | `{}`
219
255
220
256
## Outputs
@@ -224,6 +260,10 @@ firewall_rules|Range of IP addresses to allow firewall connections|map(object({}
224
260
`mysql_server_id`|The resource ID of the MySQL Server
225
261
`mysql_server_fqdn`|The FQDN of the MySQL Server
226
262
`mysql_database_id`|The resource ID of the MySQL Database
263
+
`mysql_server_private_endpoint`|id of the MySQL server Private Endpoint
264
+
`mysql_server_private_dns_zone_domain`|DNS zone name of MySQL server Private endpoints DNS name records
265
+
`mysql_server_private_endpoint_ip`|MySQL server private endpoint IPv4 Addresses
266
+
`mysql_server_private_endpoint_fqdn`|MySQL server private endpoint FQDN Addresses
Azure Database for MySQL is easy to set up, manage and scale. It automates the management and maintenance of your infrastructure and database server, including routine updates, backups and security. Enjoy maximum control of database management with custom maintenance windows and multiple configuration parameters for fine grained tuning with Flexible Server (Preview).
4
+
5
+
## Module Usage
6
+
7
+
```hcl
8
+
module "mysql-db" {
9
+
source = "kumarvna/mysql-db/azurerm"
10
+
version = "1.1.0"
11
+
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.
16
+
create_resource_group = false
17
+
resource_group_name = "rg-shared-westeurope-01"
18
+
location = "westeurope"
19
+
20
+
# MySQL Server and Database settings
21
+
mysqlserver_name = "mysqldbsrv01"
22
+
23
+
mysqlserver_settings = {
24
+
sku_name = "GP_Gen5_16"
25
+
storage_mb = 5120
26
+
version = "5.7"
27
+
# Database name, charset and collection arguments
28
+
database_name = "demomysqldb"
29
+
charset = "utf8"
30
+
collation = "utf8_unicode_ci"
31
+
# Storage Profile and other optional arguments
32
+
auto_grow_enabled = true
33
+
backup_retention_days = 7
34
+
geo_redundant_backup_enabled = false
35
+
infrastructure_encryption_enabled = false
36
+
public_network_access_enabled = true
37
+
ssl_enforcement_enabled = true
38
+
ssl_minimal_tls_version_enforced = "TLS1_2"
39
+
}
40
+
41
+
# MySQL Server Parameters
42
+
# For more information: https://docs.microsoft.com/en-us/azure/mysql/concepts-server-parameters
43
+
mysql_configuration = {
44
+
interactive_timeout = "600"
45
+
}
46
+
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
+
# Creating Private Endpoint requires, VNet name and address prefix to create a subnet
54
+
# By default this will create a `privatelink.mysql.database.azure.com` DNS zone.
55
+
# To use existing private DNS zone specify `existing_private_dns_zone` with valid zone name
0 commit comments