Adds IP whitelisting to storage buckets

This commit is contained in:
Rob Gil
2020-01-23 10:02:31 -05:00
parent d22357e609
commit 48482785ac
4 changed files with 24 additions and 3 deletions

View File

@@ -13,7 +13,7 @@ resource "azurerm_storage_account" "bucket" {
network_rules {
default_action = var.policy
virtual_network_subnet_ids = var.subnet_ids
#ip_rules = ["66.220.238.246/30"]
ip_rules = values(var.whitelist)
}
}

View File

@@ -40,3 +40,9 @@ variable "policy" {
default = "Deny"
type = string
}
variable "whitelist" {
type = map
description = "A map of whitelisted IPs and CIDR ranges. For single IPs, Azure expects just the IP, NOT a /32."
default = {}
}