Sort all variables, outputs, arguments and blocks in resource block.

Adjust code file's style.
Add `numeric = false` for `random_string.name` in `201-mysql-fs-db` module as the name is used as `azurerm_mysql_flexible_server.default`'s `administrator_login` and the login name doesn't support a name start with number.
Add minimum constraints for `random_password.password` in `201-mysql-fs-db` module as the password required a minimum complexity.
This commit is contained in:
hezijie
2022-08-29 17:03:29 +08:00
parent 65cb9c7f0e
commit e3c66ca15d
17 changed files with 128 additions and 137 deletions

View File

@ -3,14 +3,13 @@ resource "random_pet" "rg_name" {
}
resource "azurerm_resource_group" "rg" {
name = random_pet.rg_name.id
location = var.resource_group_location
name = random_pet.rg_name.id
}
resource "azurerm_attestation_provider" "corp_attestation" {
name = var.attestation_provider_name
resource_group_name = azurerm_resource_group.rg.name
location = azurerm_resource_group.rg.location
location = azurerm_resource_group.rg.location
name = var.attestation_provider_name
resource_group_name = azurerm_resource_group.rg.name
policy_signing_certificate_data = file(var.policy_file)
}

View File

@ -1,3 +1,3 @@
output "resource_group_name" {
value = azurerm_resource_group.rg.name
}
}

View File

@ -6,7 +6,6 @@ terraform {
source = "hashicorp/azurerm"
version = "~>2.0"
}
random = {
source = "hashicorp/random"
version = "~>3.0"
@ -16,4 +15,4 @@ terraform {
provider "azurerm" {
features {}
}
}

View File

@ -1,6 +1,9 @@
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 "attestation_provider_name" {
default = "attestationprovider007"
}
variable "policy_file" {
default = "~/.certs/cert.pem"
}
variable "resource_group_location" {
@ -8,10 +11,7 @@ variable "resource_group_location" {
description = "Location of the resource group."
}
variable "policy_file" {
default = "~/.certs/cert.pem"
}
variable "attestation_provider_name" {
default = "attestationprovider007"
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."
}