Commit 5c7729a8 authored by Mike Horwath's avatar Mike Horwath
Browse files

blending would be good

parent a9849baf
Loading
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -7,3 +7,7 @@
## required variables

## optional variables

## outputs
* `id` - The access rule ID.
* `zone_id` - The DNS zone ID.

outputs.tf

0 → 100644
+7 −0
Original line number Diff line number Diff line
output "whitelist_id" {
  value = ["${cloudflare_access_rule.whitelisted_ip.*.id}"]
}

output "whitelist_zone_id" {
  value = ["${cloudflare_access_rule.whitelisted_ip.*.zone_id}"]
}
+11 −0
Original line number Diff line number Diff line
# TBD

resource "cloudflare_access_rule" "whitelisted_ip" {
  count = "${length(var.whitelist_ips)}"
  notes = "Whitelist IPs from Terraform"
  mode  = "whitelist"

  configuration {
    target = "ip_range"
    value  = "${element(var.whitelist_ips, count.index)}"
  }
}

variables.tf

0 → 100644
+9 −0
Original line number Diff line number Diff line
variable "notes" {}
variable "mode" {}
variable "configuration_target" {}
variable "configuration_value" {}
variable "zone" {}

variable "whitelist_ips" {
  type = "list"
}