From e866f8430d37e4f783bf9bba408ca1d258a1b5c1 Mon Sep 17 00:00:00 2001 From: Tom Archer Date: Sun, 28 Aug 2022 09:12:59 -0700 Subject: [PATCH] readme files --- quickstart/201-mysql-fs-db/main.tf | 29 ++++++++++++------------- quickstart/201-mysql-fs-db/readme.md | 8 +++---- quickstart/201-mysql-fs-db/variables.tf | 12 +++++----- 3 files changed, 23 insertions(+), 26 deletions(-) diff --git a/quickstart/201-mysql-fs-db/main.tf b/quickstart/201-mysql-fs-db/main.tf index feab9787..9ebacf65 100644 --- a/quickstart/201-mysql-fs-db/main.tf +++ b/quickstart/201-mysql-fs-db/main.tf @@ -1,9 +1,14 @@ -// Generate random value for the Resource Group name +# Generate random resource group name resource "random_pet" "rg_name" { - prefix = var.name_prefix + prefix = var.resource_group_name_prefix } -// Generate random value for the name +resource "azurerm_resource_group" "rg" { + name = random_pet.rg_name.id + location = var.resource_group_location +} + +# Generate random value for the name resource "random_string" "name" { length = 8 upper = false @@ -11,7 +16,7 @@ resource "random_string" "name" { special = false } -// Generate random value for the login password +# Generate random value for the login password resource "random_password" "password" { length = 8 upper = true @@ -20,13 +25,7 @@ resource "random_password" "password" { override_special = "_" } -// Manages the Resource Group where the resource exists -resource "azurerm_resource_group" "default" { - name = "mysqlfsRG-${random_pet.rg_name.id}" - location = var.location -} - -// Manages the Virtual Network +# Manages the Virtual Network resource "azurerm_virtual_network" "default" { name = "vnet-${random_string.name.result}" location = azurerm_resource_group.default.location @@ -34,7 +33,7 @@ resource "azurerm_virtual_network" "default" { address_space = ["10.0.0.0/16"] } -// Manages the Subnet +# Manages the Subnet resource "azurerm_subnet" "default" { name = "subnet-${random_string.name.result}" resource_group_name = azurerm_resource_group.default.name @@ -55,13 +54,13 @@ resource "azurerm_subnet" "default" { } } -// Enables you to manage Private DNS zones within Azure DNS +# Enables you to manage Private DNS zones within Azure DNS resource "azurerm_private_dns_zone" "default" { name = "${random_string.name.result}.mysql.database.azure.com" resource_group_name = azurerm_resource_group.default.name } -// Enables you to manage Private DNS zone Virtual Network Links +# Enables you to manage Private DNS zone Virtual Network Links resource "azurerm_private_dns_zone_virtual_network_link" "default" { name = "mysqlfsVnetZone${random_string.name.result}.com" private_dns_zone_name = azurerm_private_dns_zone.default.name @@ -69,7 +68,7 @@ resource "azurerm_private_dns_zone_virtual_network_link" "default" { resource_group_name = azurerm_resource_group.default.name } -// Manages the MySQL Flexible Server +# Manages the MySQL Flexible Server resource "azurerm_mysql_flexible_server" "default" { name = "mysqlfs-${random_string.name.result}" resource_group_name = azurerm_resource_group.default.name diff --git a/quickstart/201-mysql-fs-db/readme.md b/quickstart/201-mysql-fs-db/readme.md index 31abc815..bac940f1 100644 --- a/quickstart/201-mysql-fs-db/readme.md +++ b/quickstart/201-mysql-fs-db/readme.md @@ -17,10 +17,10 @@ This template deploys an [Azure MySQL Flexible Server Database](https://registry ## Variables -| Name | Description | -|-|-| -| `name_prefix` | (Optional) Prefix of the resource name. Value defaults to: tftest| -| `location` | (Optional) Azure Region in which to deploy these resources. Value defaults to: eastus | +| Name | Description | Default | +|-|-|-| +| `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| +| `resource_group_location` | (Optional) Azure Region in which to deploy these resources. Value defaults to: eastus | ## Example diff --git a/quickstart/201-mysql-fs-db/variables.tf b/quickstart/201-mysql-fs-db/variables.tf index 7a27de0b..19f4680c 100644 --- a/quickstart/201-mysql-fs-db/variables.tf +++ b/quickstart/201-mysql-fs-db/variables.tf @@ -1,11 +1,9 @@ -variable "name_prefix" { - type = string - default = "tftest" - description = "Prefix of the resource name." +variable "resource_group_name_prefix" { + default = "rg" + description = "Prefix of the resource group name that's combined with a random ID so name is unique in your Azure subscription." } -variable "location" { - type = string +variable "resource_group_location" { default = "eastus" - description = "Location of the resource." + description = "Location of the resource group." }