Skip to content

Latest commit

 

History

History
118 lines (92 loc) · 1.96 KB

cloudflare_waf_rules.md

File metadata and controls

118 lines (92 loc) · 1.96 KB

cloudflare_waf_rules

back

Index

Terraform

terraform {
  required_providers {
    cloudflare = ">= 2.19.2"
  }
}

top

Example Usage

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

Variables

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

Datasource

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

Outputs

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