Skip to content

Commit

Permalink
feat: Examples now include storage management policy
Browse files Browse the repository at this point in the history
  • Loading branch information
habr-mms committed Jul 19, 2024
1 parent ffbfd53 commit 23241a7
Show file tree
Hide file tree
Showing 3 changed files with 94 additions and 0 deletions.
41 changes: 41 additions & 0 deletions examples/apply_main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,47 @@ module "storage" {
ip_rules = ["172.0.0.2"]
virtual_network_subnet_ids = [module.network.subnet["snet-app-mms"].id]
}
blob_properties = {
last_access_time_enabled = true
}
tags = {
project = "mms-github"
environment = terraform.workspace
managed-by = "terraform"
}
}
}
storage_management_policy = {
policy = {
storage_account_id = module.storage.storage_account.stmms.id
rule = {
rule1 = {
filters = {
blob_types = ["blockBlob"]
prefix_match = ["terraform"]
match_blob_index_tag = {
name = "project"
value = "mms-github"
operation = "=="
}
}
actions = {
base_blob = {
tier_to_cool_after_days_since_last_access_time_greater_than = 7
auto_tier_to_hot_from_cool_enabled = true
tier_to_cold_after_days_since_modification_greater_than = 30
}
snapshot = {
tier_to_archive_after_days_since_last_tier_change_greater_than = 60
delete_after_days_since_creation_greater_than = 180
}
version = {
tier_to_cold_after_days_since_creation_greater_than = 30
delete_after_days_since_creation = 90
}
}
}
}
}
}
storage_container = {
Expand Down
36 changes: 36 additions & 0 deletions examples/full_main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,49 @@ module "storage" {
ip_rules = ["172.0.0.2"]
virtual_network_subnet_ids = [module.network.subnet["snet-app-mms"].id]
}
blob_properties = {
last_access_time_enabled = true
}
tags = {
project = "mms-github"
environment = terraform.workspace
managed-by = "terraform"
}
}
}
storage_management_policy = {
policy = {
storage_account_id = module.storage.storage_account.stmms.id
rule = {
rule1 = {
filters = {
blob_types = ["blockBlob"]
prefix_match = ["terraform"]
match_blob_index_tag = {
name = "project"
value = "mms-github"
operation = "=="
}
}
actions = {
base_blob = {
tier_to_cool_after_days_since_last_access_time_greater_than = 7
auto_tier_to_hot_from_cool_enabled = true
tier_to_cold_after_days_since_modification_greater_than = 30
}
snapshot = {
tier_to_archive_after_days_since_last_tier_change_greater_than = 60
delete_after_days_since_creation_greater_than = 180
}
version = {
tier_to_cold_after_days_since_creation_greater_than = 30
delete_after_days_since_creation = 90
}
}
}
}
}
}
storage_container = {
terraform = {
storage_account_name = module.storage.storage_account["stmms"].name
Expand Down
17 changes: 17 additions & 0 deletions examples/min_main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,23 @@ module "storage" {
resource_group_name = "rg-mms-github"
}
}
storage_management_policy = {
policy = {
storage_account_id = module.storage.storage_account.stmms.id
rule = {
rule1 = {
filters = {
blob_types = ["blockBlob"]
}
actions = {
base_blob = {
delete_after_days_since_modification_greater_than = 7
}
}
}
}
}
}
storage_container = {
terraform = {
storage_account_name = module.storage.storage_account["stmms"].name
Expand Down

0 comments on commit 23241a7

Please sign in to comment.