Skip to content

Commit e866f84

Browse files
committed
readme files
1 parent 0bb3ff1 commit e866f84

3 files changed

Lines changed: 23 additions & 26 deletions

File tree

quickstart/201-mysql-fs-db/main.tf

Lines changed: 14 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,22 @@
1-
// Generate random value for the Resource Group name
1+
# Generate random resource group name
22
resource "random_pet" "rg_name" {
3-
prefix = var.name_prefix
3+
prefix = var.resource_group_name_prefix
44
}
55

6-
// Generate random value for the name
6+
resource "azurerm_resource_group" "rg" {
7+
name = random_pet.rg_name.id
8+
location = var.resource_group_location
9+
}
10+
11+
# Generate random value for the name
712
resource "random_string" "name" {
813
length = 8
914
upper = false
1015
lower = true
1116
special = false
1217
}
1318

14-
// Generate random value for the login password
19+
# Generate random value for the login password
1520
resource "random_password" "password" {
1621
length = 8
1722
upper = true
@@ -20,21 +25,15 @@ resource "random_password" "password" {
2025
override_special = "_"
2126
}
2227

23-
// Manages the Resource Group where the resource exists
24-
resource "azurerm_resource_group" "default" {
25-
name = "mysqlfsRG-${random_pet.rg_name.id}"
26-
location = var.location
27-
}
28-
29-
// Manages the Virtual Network
28+
# Manages the Virtual Network
3029
resource "azurerm_virtual_network" "default" {
3130
name = "vnet-${random_string.name.result}"
3231
location = azurerm_resource_group.default.location
3332
resource_group_name = azurerm_resource_group.default.name
3433
address_space = ["10.0.0.0/16"]
3534
}
3635

37-
// Manages the Subnet
36+
# Manages the Subnet
3837
resource "azurerm_subnet" "default" {
3938
name = "subnet-${random_string.name.result}"
4039
resource_group_name = azurerm_resource_group.default.name
@@ -55,21 +54,21 @@ resource "azurerm_subnet" "default" {
5554
}
5655
}
5756

58-
// Enables you to manage Private DNS zones within Azure DNS
57+
# Enables you to manage Private DNS zones within Azure DNS
5958
resource "azurerm_private_dns_zone" "default" {
6059
name = "${random_string.name.result}.mysql.database.azure.com"
6160
resource_group_name = azurerm_resource_group.default.name
6261
}
6362

64-
// Enables you to manage Private DNS zone Virtual Network Links
63+
# Enables you to manage Private DNS zone Virtual Network Links
6564
resource "azurerm_private_dns_zone_virtual_network_link" "default" {
6665
name = "mysqlfsVnetZone${random_string.name.result}.com"
6766
private_dns_zone_name = azurerm_private_dns_zone.default.name
6867
virtual_network_id = azurerm_virtual_network.default.id
6968
resource_group_name = azurerm_resource_group.default.name
7069
}
7170

72-
// Manages the MySQL Flexible Server
71+
# Manages the MySQL Flexible Server
7372
resource "azurerm_mysql_flexible_server" "default" {
7473
name = "mysqlfs-${random_string.name.result}"
7574
resource_group_name = azurerm_resource_group.default.name

quickstart/201-mysql-fs-db/readme.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,10 @@ This template deploys an [Azure MySQL Flexible Server Database](https://registry
1717

1818
## Variables
1919

20-
| Name | Description |
21-
|-|-|
22-
| `name_prefix` | (Optional) Prefix of the resource name. Value defaults to: tftest|
23-
| `location` | (Optional) Azure Region in which to deploy these resources. Value defaults to: eastus |
20+
| Name | Description | Default |
21+
|-|-|-|
22+
| `resource_group_name_prefix` | (Optional) Prefix of the resource group name that's combined with a random ID so name is unique in your Azure subscription. Value defaults to: rg|
23+
| `resource_group_location` | (Optional) Azure Region in which to deploy these resources. Value defaults to: eastus |
2424

2525
## Example
2626

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,9 @@
1-
variable "name_prefix" {
2-
type = string
3-
default = "tftest"
4-
description = "Prefix of the resource name."
1+
variable "resource_group_name_prefix" {
2+
default = "rg"
3+
description = "Prefix of the resource group name that's combined with a random ID so name is unique in your Azure subscription."
54
}
65

7-
variable "location" {
8-
type = string
6+
variable "resource_group_location" {
97
default = "eastus"
10-
description = "Location of the resource."
8+
description = "Location of the resource group."
119
}

0 commit comments

Comments
 (0)