Fix 101-storage-static-website (#188)

* fix 101-storage-static-website

---------

Co-authored-by: zjhe <hezijie@microsoft.com>
This commit is contained in:
lonegunmanb
2023-03-14 07:23:47 +08:00
committed by GitHub
parent fcd4f1d54f
commit 8aa98d5569
4 changed files with 35 additions and 11 deletions

View File

@ -1,13 +1,18 @@
provider "azurerm" {
version = "=1.36.0"
resource "azurerm_resource_group" "default" {
name = "${local.name}-${var.environment}-rg"
location = var.location
}
resource "azurerm_resource_group" "default" {
name = "${var.name}-${var.environment}-rg"
location = "westus"
resource "random_string" "name" {
count = var.name == null ? 1 : 0
length = 8
upper = false
special = false
}
locals {
storage_account_name = "${var.dns_prefix}${var.name}${substr(var.environment, 0, 2)}"
name = try(random_string.name[0].result, var.name)
storage_account_name = "${var.dns_prefix}${local.name}${substr(var.environment, 0, 2)}"
}