Commit 848de25a authored by Mike Horwath's avatar Mike Horwath
Browse files

set some defaults, blacklist IPs

parent 3dc760ef
Loading
Loading
Loading
Loading
Loading
+13 −2
Original line number Diff line number Diff line
# TBD

# whitelist an IP
resource "cloudflare_access_rule" "whitelisted_ip" {
  count = "${length(var.whitelist_ips)}"
  notes = "${var.notes}"
@@ -10,3 +9,15 @@ resource "cloudflare_access_rule" "whitelisted_ip" {
    value  = "${element(var.whitelist_ips, count.index)}"
  }
}

# blacklist an IP
resource "cloudflare_access_rule" "blacklisted_ip" {
  count = "${length(var.blacklist_ips)}"
  notes = "${var.notes}"
  mode  = "block"

  configuration {
    target = "ip_range"
    value  = "${element(var.blacklist_ips, count.index)}"
  }
}
+7 −1
Original line number Diff line number Diff line
@@ -6,4 +6,10 @@ variable "zone" {}

variable "whitelist_ips" {
  type    = "list"
  default = ""
}

variable "blacklist_ips" {
  type    = "list"
  default = ""
}