included random string suffix

This commit is contained in:
Andy Aviles 2024-06-17 09:50:53 -04:00 committed by lonegunmanb
parent cd38055ba3
commit d5c754a94b
2 changed files with 8 additions and 2 deletions

View File

@ -5,7 +5,7 @@ resource "azurerm_resource_group" "default" {
}
resource "azurerm_storage_account" "default" {
name = "${var.names}storage"
name = "${var.names}storage${random_string.suffix.result}"
location = azurerm_resource_group.default.location
resource_group_name = azurerm_resource_group.default.name
account_tier = "Standard"
@ -14,7 +14,7 @@ resource "azurerm_storage_account" "default" {
}
resource "azurerm_key_vault" "default" {
name = "${var.names}keyvault"
name = "${var.names}keyvault${random_string.suffix.result}"
location = azurerm_resource_group.default.location
resource_group_name = azurerm_resource_group.default.name
tenant_id = data.azurerm_client_config.current.tenant_id

View File

@ -17,6 +17,12 @@ variable "sku" {
default = "S0"
}
resource "random_string" "suffix" {
length = 4
special = false
upper = false
}
/*Optional: For Customer Managed Keys, uncomment this part AND the corresponding section in hub.tf
variable "cmk_keyvault_key_uri" {
description = "Key vault uri to access the encryption key."