-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathstorage.tf
44 lines (39 loc) · 1.71 KB
/
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
/**
* Copyright 2020 Quortex
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
# A storage account used to store cached segments.
resource "azurerm_storage_account" "quortex" {
count = length(var.storage_containers) > 0 ? 1 : 0
name = substr(replace(var.storage_account_name, "-", ""), 0, 24)
resource_group_name = var.resource_group_name
location = var.location
account_tier = var.storage_tier
account_replication_type = var.storage_replication_type
account_kind = var.storage_kind
allow_nested_items_to_be_public = var.allow_nested_items_to_be_public
min_tls_version = var.min_tls_version
cross_tenant_replication_enabled = var.cross_tenant_replication_enabled
blob_properties {
last_access_time_enabled = var.last_access_time_enabled
}
tags = var.tags
}
# The storage containers for persistence purpose.
resource "azurerm_storage_container" "quortex" {
for_each = var.storage_containers
name = "${var.storage_account_name}-${each.value}"
storage_account_name = azurerm_storage_account.quortex[0].name
container_access_type = "private"
}