Skip to content

Commit 9c04592

Browse files
committed
final configuration for version 1.0
1 parent 03a6672 commit 9c04592

File tree

7 files changed

+154
-14
lines changed

7 files changed

+154
-14
lines changed

README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ Azure Database for MariaDB is a relational database service based on the open-so
1717

1818
```hcl
1919
module "mariadb" {
20-
source = "kumarvna/mariadb/azurerm"
20+
source = "kumarvna/mariadb-server/azurerm"
2121
version = "1.0.0"
2222
2323
# By default, this module will create a resource group
@@ -61,7 +61,8 @@ module "mariadb" {
6161
subnet_id = var.subnet_id
6262
6363
# (Optional) To enable Azure Monitoring for Azure MariaDB database
64-
# (Optional) Specify `enable_logs_to_storage_account` to save monitoring logs to storage.
64+
# (Optional) Specify `enable_logs_to_storage_account` to save monitoring logs to storage.
65+
# Create required storage account by specifying optional `storage_account_name` variable.
6566
log_analytics_workspace_name = "loganalytics-we-sharedtest2"
6667
enable_logs_to_storage_account = true
6768
storage_account_name = "mariadblogdignostics"

examples/MariaDB_Server/README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ Azure Database for MariaDB is a relational database service based on the open-so
66

77
```terraform
88
module "mariadb" {
9-
source = "kumarvna/mariadb/azurerm"
9+
source = "kumarvna/mariadb-server/azurerm"
1010
version = "1.0.0"
1111
1212
# By default, this module will create a resource group
@@ -51,6 +51,7 @@ module "mariadb" {
5151
5252
# (Optional) To enable Azure Monitoring for Azure MariaDB database
5353
# (Optional) Specify `enable_logs_to_storage_account` to save monitoring logs to storage.
54+
# Create required storage account by specifying optional `storage_account_name` variable.
5455
log_analytics_workspace_name = "loganalytics-we-sharedtest2"
5556
enable_logs_to_storage_account = true
5657
storage_account_name = "mariadblogdignostics"

examples/MariaDB_Server/main.tf

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
module "mariadb" {
2-
source = "kumarvna/mariadb/azurerm"
2+
source = "kumarvna/mariadb-server/azurerm"
33
version = "1.0.0"
44

55
# By default, this module will create a resource group
@@ -44,6 +44,7 @@ module "mariadb" {
4444

4545
# (Optional) To enable Azure Monitoring for Azure MariaDB database
4646
# (Optional) Specify `enable_logs_to_storage_account` to save monitoring logs to storage.
47+
# Create required storage account by specifying optional `storage_account_name` variable.
4748
log_analytics_workspace_name = "loganalytics-we-sharedtest2"
4849
enable_logs_to_storage_account = true
4950
storage_account_name = "mariadblogdignostics"

examples/MariaDB_Server/output.tf

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
output "resource_group_name" {
2+
description = "The name of the resource group in which resources are created"
3+
value = module.mariadb.resource_group_name
4+
}
5+
6+
output "resource_group_location" {
7+
description = "The location of the resource group in which resources are created"
8+
value = module.mariadb.resource_group_location
9+
}
10+
11+
output "storage_account_id" {
12+
description = "The ID of the storage account"
13+
value = module.mariadb.storage_account_id
14+
}
15+
16+
output "storage_account_name" {
17+
description = "The name of the storage account"
18+
value = module.mariadb.storage_account_name
19+
}
20+
21+
output "mariadb_server_id" {
22+
description = "The resource ID of the MariaDB Server"
23+
value = module.mariadb.mariadb_server_id
24+
}
25+
26+
output "mariadb_server_fqdn" {
27+
description = "The FQDN of the MariaDB Server"
28+
value = module.mariadb.mariadb_server_fqdn
29+
}
30+
31+
output "mariadb_database_id" {
32+
description = "The resource ID of the MariaDB Database"
33+
value = module.mariadb.mariadb_database_id
34+
}
35+

examples/README.md

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ Azure Database for MariaDB is a relational database service based on the open-so
66

77
```terraform
88
module "mariadb" {
9-
source = "kumarvna/mariadb/azurerm"
9+
source = "kumarvna/mariadb-server/azurerm"
1010
version = "1.0.0"
1111
1212
# By default, this module will create a resource group
@@ -51,6 +51,7 @@ module "mariadb" {
5151
5252
# (Optional) To enable Azure Monitoring for Azure MariaDB database
5353
# (Optional) Specify `enable_logs_to_storage_account` to save monitoring logs to storage.
54+
# Create required storage account by specifying optional `storage_account_name` variable.
5455
log_analytics_workspace_name = "loganalytics-we-sharedtest2"
5556
enable_logs_to_storage_account = true
5657
storage_account_name = "mariadblogdignostics"
@@ -80,7 +81,7 @@ module "mariadb" {
8081

8182
```hcl
8283
module "mariadb" {
83-
source = "kumarvna/mariadb/azurerm"
84+
source = "kumarvna/mariadb-server/azurerm"
8485
version = "1.0.0"
8586
8687
# By default, this module will create a resource group
@@ -121,10 +122,11 @@ module "mariadb" {
121122
}
122123
123124
# Use Virtual Network service endpoints and rules for Azure Database for MariaDB
124-
subnet_id = "/subscriptions/1e3f0eeb-2235-44cd-b3a3-dcded0861d06/resourceGroups/rg-shared-westeurope-01/providers/Microsoft.Network/virtualNetworks/vnet-shared-hub-westeurope-001/subnets/snet-appgateway" #var.subnet_id
125+
subnet_id = var.subnet_id
125126
126127
# (Optional) To enable Azure Monitoring for Azure MariaDB database
127-
# (Optional) Specify `enable_logs_to_storage_account` to save monitoring logs to storage.
128+
# (Optional) Specify `enable_logs_to_storage_account` to save monitoring logs to storage.
129+
# Create required storage account by specifying optional `storage_account_name` variable.
128130
log_analytics_workspace_name = "loganalytics-we-sharedtest2"
129131
enable_logs_to_storage_account = true
130132
storage_account_name = "mariadblogdignostics"
Lines changed: 100 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,100 @@
1+
# Azure Database for MariaDB Terraform Module
2+
3+
Azure Database for MariaDB is a relational database service based on the open-source MariaDB Server engine. It's a fully managed database as a service offering that can handle mission-critical workloads with predictable performance and dynamic scalability.
4+
5+
## Module Usage
6+
7+
```terraform
8+
module "mariadb" {
9+
source = "kumarvna/mariadb-server/azurerm"
10+
version = "1.0.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+
# MariaDB Server and Database settings
21+
mariadb_server_name = "mariadbsqlsrv01"
22+
23+
mariadb_settings = {
24+
sku_name = "GP_Gen5_16"
25+
storage_mb = 5120
26+
version = "10.2"
27+
# default admin user `sqladmin` and can be specified as per the choice here
28+
# by default random password created by this module. required password can be specified here
29+
admin_username = "sqladmin"
30+
admin_password = "H@Sh1CoR3!"
31+
# Database name, charset and collection arguments
32+
database_name = "demomariadb01"
33+
charset = "utf8"
34+
collation = "utf8_unicode_ci"
35+
# Storage Profile and other optional arguments
36+
auto_grow_enabled = true
37+
backup_retention_days = 7
38+
geo_redundant_backup_enabled = false
39+
public_network_access_enabled = true
40+
ssl_enforcement_enabled = true
41+
}
42+
43+
# Sets a MariaDB Configuration value on a MariaDB Server.
44+
# For more information: https://mariadb.com/kb/en/server-system-variables/
45+
mariadb_configuration = {
46+
interactive_timeout = "600"
47+
}
48+
49+
# Use Virtual Network service endpoints and rules for Azure Database for MariaDB
50+
subnet_id = var.subnet_id
51+
52+
# (Optional) To enable Azure Monitoring for Azure MariaDB database
53+
# (Optional) Specify `enable_logs_to_storage_account` to save monitoring logs to storage.
54+
# Create required storage account by specifying optional `storage_account_name` variable.
55+
log_analytics_workspace_name = "loganalytics-we-sharedtest2"
56+
enable_logs_to_storage_account = true
57+
storage_account_name = "mariadblogdignostics"
58+
59+
# Creating Private Endpoint requires, VNet name and address prefix to create a subnet
60+
# By default this will create a `privatelink.mysql.database.azure.com` DNS zone.
61+
# To use existing private DNS zone specify `existing_private_dns_zone` with valid zone name
62+
enable_private_endpoint = true
63+
virtual_network_name = "vnet-shared-hub-westeurope-001"
64+
private_subnet_address_prefix = ["10.1.5.0/29"]
65+
existing_private_dns_zone = "demo.example.com"
66+
67+
# Firewall Rules to allow azure and external clients and specific Ip address/ranges.
68+
firewall_rules = {
69+
access-to-azure = {
70+
start_ip_address = "0.0.0.0"
71+
end_ip_address = "0.0.0.0"
72+
},
73+
desktop-ip = {
74+
start_ip_address = "49.204.228.223"
75+
end_ip_address = "49.204.228.223"
76+
}
77+
}
78+
79+
# Tags for Azure Resources
80+
tags = {
81+
Terraform = "true"
82+
Environment = "dev"
83+
Owner = "test-user"
84+
}
85+
}
86+
```
87+
88+
## Terraform Usage
89+
90+
To run this example you need to execute following Terraform commands
91+
92+
```hcl
93+
terraform init
94+
95+
terraform plan
96+
97+
terraform apply
98+
```
99+
100+
Run `terraform destroy` when you don't need these resources.

examples/mariadb_server_with_private_endpoints/main.tf

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
module "mariadb" {
2-
//source = "kumarvna/mariadb/azurerm"
3-
//version = "1.0.0"
4-
source = "../../"
2+
source = "kumarvna/mariadb-server/azurerm"
3+
version = "1.0.0"
54

65
# By default, this module will create a resource group
76
# proivde a name to use an existing resource group and set the argument
@@ -41,10 +40,11 @@ module "mariadb" {
4140
}
4241

4342
# Use Virtual Network service endpoints and rules for Azure Database for MariaDB
44-
subnet_id = "/subscriptions/1e3f0eeb-2235-44cd-b3a3-dcded0861d06/resourceGroups/rg-shared-westeurope-01/providers/Microsoft.Network/virtualNetworks/vnet-shared-hub-westeurope-001/subnets/snet-appgateway" #var.subnet_id
43+
subnet_id = var.subnet_id
4544

4645
# (Optional) To enable Azure Monitoring for Azure MariaDB database
47-
# (Optional) Specify `enable_logs_to_storage_account` to save monitoring logs to storage.
46+
# (Optional) Specify `enable_logs_to_storage_account` to save monitoring logs to storage.
47+
# Create required storage account by specifying optional `storage_account_name` variable.
4848
log_analytics_workspace_name = "loganalytics-we-sharedtest2"
4949
enable_logs_to_storage_account = true
5050
storage_account_name = "mariadblogdignostics"
@@ -55,7 +55,7 @@ module "mariadb" {
5555
enable_private_endpoint = true
5656
virtual_network_name = "vnet-shared-hub-westeurope-001"
5757
private_subnet_address_prefix = ["10.1.5.0/29"]
58-
existing_private_dns_zone = "roshinidemozone.com" #"demo.example.com"
58+
existing_private_dns_zone = "demo.example.com"
5959

6060
# Firewall Rules to allow azure and external clients and specific Ip address/ranges.
6161
firewall_rules = {

0 commit comments

Comments
 (0)