-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathstorage.tf
30 lines (24 loc) · 912 Bytes
/
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
resource "azurerm_storage_account" "main" {
name = "demo4${var.environment_name}dso"
resource_group_name = azurerm_resource_group.main.name
location = azurerm_resource_group.main.location
account_tier = "Standard"
account_replication_type = "LRS"
allow_nested_items_to_be_public = false
lifecycle {
prevent_destroy = true
}
}
resource "azurerm_storage_container" "appdata" {
name = "appdata"
storage_account_name = azurerm_storage_account.main.name
container_access_type = "private"
lifecycle {
prevent_destroy = true
}
}
resource "azurerm_role_assignment" "app_mainstorage_access" {
scope = azurerm_storage_account.main.id
role_definition_name = "Reader and Data Access"
principal_id = azurerm_user_assigned_identity.app.principal_id
}