-
Notifications
You must be signed in to change notification settings - Fork 1
/
02_storage.tf
56 lines (52 loc) · 1.56 KB
/
02_storage.tf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
resource "azurerm_storage_account" "storage" {
name = lower(replace(var.function_app, "-", ""))
resource_group_name = azurerm_resource_group.rg.name
location = azurerm_resource_group.rg.location
account_tier = "Standard"
account_kind = "StorageV2"
account_replication_type = "LRS"
tags = var.tags
}
# Function App code deployment
resource "azurerm_storage_container" "deployments" {
name = "function-releases"
storage_account_name = azurerm_storage_account.storage.name
container_access_type = "private"
}
resource "azurerm_storage_blob" "appcode" {
name = "functions.zip"
storage_account_name = azurerm_storage_account.storage.name
storage_container_name = azurerm_storage_container.deployments.name
type = "Block"
source = var.package
content_md5 = filemd5(var.package)
}
data "azurerm_storage_account_sas" "sas" {
connection_string = azurerm_storage_account.storage.primary_connection_string
https_only = true
start = "2020-12-25"
expiry = "2023-12-31"
resource_types {
object = true
container = false
service = false
}
services {
blob = true
queue = false
table = false
file = false
}
permissions {
read = true
write = false
delete = false
list = false
add = false
create = false
update = false
process = false
filter = false
tag = false
}
}