2
2
3
3
This is a nascent implementation of an intelligent storage solution on Microsoft Azure,
4
4
managed by Terraform.
5
- The current feature set is limited to lifecycle management, in which the the access tier
5
+ The current feature set is limited to lifecycle management, in which the access tier
6
6
of blob storage is automatically changed
7
7
from hot to cool to archive based on the last modified time of the blob.
8
8
@@ -31,14 +31,10 @@ resource "azurerm_resource_group" "i2c23proj" {
31
31
32
32
## Create storage account and its management policy
33
33
34
- Using the last access time of a blob rather than the modification time as the determinant of
35
- when to move a blob to a cooler tier might make more sense.
36
- However, this apparently requires that the
37
- "last access time based tracking policy must be enabled before using its specific actions
38
- in object lifecycle management policy," (the error message returned from ` tf apply ` ),
39
- but it's not obvious how to do that.
34
+ Disabling public network access interfered with creating a storage container.
35
+ Need to look into that.
40
36
41
- Also, Azure storage has hot, cool, cold and archive tiers, but the strings to set these
37
+ Azure storage has hot, cool, cold and archive tiers, but the strings to set these
42
38
values in Terraform (such as ` tier_to_cool_after_days_since_modification_greater_than ` )
43
39
seem not to have a cold analog.
44
40
@@ -56,7 +52,11 @@ resource "azurerm_storage_account" "i2c23proj" {
56
52
access_tier = "Hot"
57
53
# public_network_access_enabled = false
58
54
allow_nested_items_to_be_public = true
59
- # enable_last_access_tracking = true
55
+
56
+ blob_properties {
57
+ versioning_enabled = true
58
+ last_access_time_enabled = true
59
+ }
60
60
}
61
61
62
62
@@ -71,9 +71,9 @@ resource "azurerm_storage_management_policy" "i2c23proj" {
71
71
}
72
72
actions {
73
73
base_blob {
74
- tier_to_cool_after_days_since_modification_greater_than = var.time_to_cool
75
- tier_to_archive_after_days_since_modification_greater_than = var.time_to_archive
76
- delete_after_days_since_modification_greater_than = var.time_to_delete
74
+ tier_to_cool_after_days_since_last_access_time_greater_than = var.time_to_cool
75
+ tier_to_archive_after_days_since_last_access_time_greater_than = var.time_to_archive
76
+ delete_after_days_since_last_access_time_greater_than = var.time_to_delete
77
77
}
78
78
snapshot {
79
79
delete_after_days_since_creation_greater_than = var.snapshot_retention
0 commit comments