From 8ac858ede106eb34f61d2ead92ebc0dc5807d281 Mon Sep 17 00:00:00 2001 From: Volkan Selcuk Date: Wed, 20 Dec 2023 20:55:07 +0100 Subject: [PATCH] PLT-756 added bot-management to zone configuration --- README.md | 15 +++++++++++++++ main.tf | 6 ++++++ variables.tf | 10 ++++++++++ 3 files changed, 31 insertions(+) diff --git a/README.md b/README.md index 860d746..f5ace1d 100644 --- a/README.md +++ b/README.md @@ -159,6 +159,21 @@ list(object({ Default: `[]` +### [bot\_management](#input\_bot\_management) + +Description: Cloudflare bot management configuration. + +Type: + +```hcl +object({ + auto_update_model = optional(bool, false) + enable_js = optional(bool, false) + }) +``` + +Default: `{}` + diff --git a/main.tf b/main.tf index bd8b6c0..f1ad700 100644 --- a/main.tf +++ b/main.tf @@ -113,3 +113,9 @@ resource "cloudflare_ruleset" "http_config_settings" { } } } + +resource "cloudflare_bot_management" "this" { + zone_id = cloudflare_zone.this.id + auto_update_model = var.bot_management.auto_update_model + enable_js = var.bot_management.enable_js +} diff --git a/variables.tf b/variables.tf index 6a36cf8..de67e44 100644 --- a/variables.tf +++ b/variables.tf @@ -103,3 +103,13 @@ variable "http_config_settings" { })) default = [] } + +# https://registry.terraform.io/providers/cloudflare/cloudflare/latest/docs/resources/bot_management +variable "bot_management" { + description = "Cloudflare bot management configuration." + type = object({ + auto_update_model = optional(bool, false) + enable_js = optional(bool, false) + }) + default = {} +}