back
terraform {
required_providers {
cloudflare = ">= 2.19.2"
}
}
top
module "cloudflare_waf_rules" {
source = "./modules/cloudflare/d/cloudflare_waf_rules"
# package_id - (optional) is a type of string
package_id = null
# zone_id - (required) is a type of string
zone_id = null
filter = [{
description = null
group_id = null
mode = null
}]
}
top
variable "package_id" {
description = "(optional)"
type = string
default = null
}
variable "zone_id" {
description = "(required)"
type = string
}
variable "filter" {
description = "nested block: NestingList, min items: 0, max items: 1"
type = set(object(
{
description = string
group_id = string
mode = string
}
))
default = []
}
top
data "cloudflare_waf_rules" "this" {
# package_id - (optional) is a type of string
package_id = var.package_id
# zone_id - (required) is a type of string
zone_id = var.zone_id
dynamic "filter" {
for_each = var.filter
content {
# description - (optional) is a type of string
description = filter.value["description"]
# group_id - (optional) is a type of string
group_id = filter.value["group_id"]
# mode - (optional) is a type of string
mode = filter.value["mode"]
}
}
}
top
output "id" {
description = "returns a string"
value = data.cloudflare_waf_rules.this.id
}
output "rules" {
description = "returns a list of object"
value = data.cloudflare_waf_rules.this.rules
}
output "this" {
value = cloudflare_waf_rules.this
}
top