Changes to storage

This commit is contained in:
Tom Archer 2024-10-31 19:25:06 -07:00
parent 1b0212fb94
commit 3ee47f573a
2 changed files with 18 additions and 12 deletions

View File

@ -13,22 +13,28 @@ resource "random_string" "unique_id" {
} }
locals { locals {
functionAppName = var.appName functionAppName = "fnapp${random_string.unique_id.result}"
hostingPlanName = var.appName hostingPlanName = "fnapp${random_string.unique_id.result}"
applicationInsightsName = var.appName applicationInsightsName = "fnapp${random_string.unique_id.result}"
storageAccountName = "${random_string.unique_id.result}azfunctions" storageAccountName = "${random_string.unique_id.result}azfunctions"
functionWorkerRuntime = var.runtime functionWorkerRuntime = var.runtime
} }
resource "azurerm_storage_account" "storageAccount" { # Generate random value for the storage account name
name = local.storageAccountName resource "random_string" "storage_account_name" {
location = azurerm_resource_group.rg.location length = 8
resource_group_name = azurerm_resource_group.rg.name lower = true
account_tier = "Standard" numeric = false
account_replication_type = var.storageAccountType special = false
upper = false
}
enable_https_traffic_only = true resource "azurerm_storage_account" "storageAccount" {
allow_blob_public_access = false name = random_string.storage_account_name.result
resource_group_name = azurerm_resource_group.rg.name
location = azurerm_resource_group.rg.location
account_tier = "Standard"
account_replication_type = "LRS"
} }
resource "azurerm_app_service_plan" "hostingPlan" { resource "azurerm_app_service_plan" "hostingPlan" {

View File

@ -12,7 +12,7 @@ variable "resource_group_location" {
variable "appName" { variable "appName" {
type = string type = string
default = "fnapp${random_string.unique_id.result}" default = "fnapp"
description = "The name of the function app that you wish to create." description = "The name of the function app that you wish to create."
} }