-
Notifications
You must be signed in to change notification settings - Fork 0
/
storage-account.tf
31 lines (26 loc) · 972 Bytes
/
storage-account.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
resource "random_integer" "randint" {
min = 1000
max = 9999
}
resource "azurerm_storage_account" "sa" {
name = "${var.prefix}${random_integer.randint.result}"
resource_group_name = azurerm_resource_group.rg.name
location = azurerm_resource_group.rg.location
account_kind = var.saVars["account_kind"]
account_tier = var.saVars["account_tier"]
access_tier = var.saVars["access_tier"]
account_replication_type = var.saVars["account_replication_type"]
static_website {
index_document = "index.html"
error_404_document = "404.html"
}
}
resource "azurerm_storage_blob" "website" {
for_each = var.blobs
name = each.key
storage_account_name = azurerm_storage_account.sa.name
storage_container_name = "$web"
type = "Block"
content_type = "text/html"
source = each.value
}