Skip to content

Commit

Permalink
Feat: create and mount Azure file share (#1775)
Browse files Browse the repository at this point in the history
  • Loading branch information
thekaveman committed Nov 8, 2023
2 parents fcf009b + bae7fab commit c99b74d
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 1 deletion.
13 changes: 13 additions & 0 deletions terraform/app_service.tf
Expand Up @@ -10,6 +10,10 @@ resource "azurerm_service_plan" "main" {
}
}

locals {
data_mount = "/home/calitp/app/data"
}

resource "azurerm_linux_web_app" "main" {
name = "AS-CDT-PUB-VIP-CALITP-${local.env_letter}-001"
location = data.azurerm_resource_group.main.location
Expand Down Expand Up @@ -166,6 +170,15 @@ resource "azurerm_linux_web_app" "main" {
"SBMTD_AGENCY_JWS_SIGNING_ALG" = "${local.secret_prefix}sbmtd-agency-jws-signing-alg)"
}

storage_account {
access_key = azurerm_storage_account.main.primary_access_key
account_name = azurerm_storage_account.main.name
name = "benefits-data"
type = "AzureFiles"
share_name = azurerm_storage_share.data.name
mount_path = local.data_mount
}

lifecycle {
prevent_destroy = true
ignore_changes = [tags]
Expand Down
14 changes: 13 additions & 1 deletion terraform/storage.tf
Expand Up @@ -18,8 +18,20 @@ resource "azurerm_storage_account" "main" {
}
}


lifecycle {
ignore_changes = [tags]
}
}

resource "azurerm_storage_share" "data" {
name = "benefits-data"
storage_account_name = azurerm_storage_account.main.name
quota = 5
enabled_protocol = "SMB"
acl {
id = "benefits-data-rwdl"
access_policy {
permissions = "rwdl"
}
}
}

0 comments on commit c99b74d

Please sign in to comment.