-
Notifications
You must be signed in to change notification settings - Fork 17
/
locals.tf
12 lines (11 loc) · 880 Bytes
/
locals.tf
1
2
3
4
5
6
7
8
9
10
11
12
locals {
# https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/storage_account_network_rules#ip_rules
# > Small address ranges using "/31" or "/32" prefix sizes are not supported. These ranges should be configured using individual IP address rules without prefix specified.
storage_ip_rules = toset(flatten([for cidr in var.allowed_cidrs : (length(regexall("/3.", cidr)) > 0 ? [cidrhost(cidr, 0), cidrhost(cidr, -1)] : [cidr])]))
pitr_enabled = (
alltrue([var.blob_data_protection.change_feed_enabled, var.blob_data_protection.versioning_enabled, var.blob_data_protection.container_point_in_time_restore])
&& var.blob_data_protection.delete_retention_policy_in_days > 0
&& var.blob_data_protection.container_delete_retention_policy_in_days > 2
&& !(var.nfsv3_enabled || var.sftp_enabled || var.account_tier == "Premium")
)
}