Loading README.md +4 −0 Original line number Diff line number Diff line Loading @@ -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}"] } rule.tf +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" } Loading
README.md +4 −0 Original line number Diff line number Diff line Loading @@ -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}"] }
rule.tf +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" }