Terraform Support for Snippets and Rules
Cloudflare Snippets can now be managed via Terraform, enabling infrastructure-as-code deployment and updates of snippet code and rules without using the dashboard.
Now, you can manage Cloudflare Snippets with Terraform. Use infrastructure-as-code to deploy and update Snippet code and rules without manual changes in the dashboard.
Example Terraform configuration:
resource "cloudflare_snippet" "my_snippet" {
zone_id = "<ZONE_ID>"
name = "my_test_snippet_1"
main_module = "file1.js"
files {
name = "file1.js"
content = file("file1.js")
}
}
resource "cloudflare_snippet_rules" "cookie_snippet_rule" {
zone_id = "<ZONE_ID>"
rules {
enabled = true
expression = "http.cookie eq \"a=b\""
description = "Trigger snippet on specific cookie"
snippet_name = "my_test_snippet_1"
}
depends_on = [cloudflare_snippet.my_snippet]
}
Learn more in the Configure Snippets using Terraform documentation.
Source: original entry ↗
More from Cloudflare
Follow Cloudflare to get its new changes in your feed and email digest.
Cloudflare One Client for Windows hotfix - trusted certificate chains
A new GA release for Windows Cloudflare One Client is available, addressing an issue with building trusted certificate chains.
Cloudflare One Client for macOS - Trusted Certificate Chain Fix
A new GA release of the macOS Cloudflare One Client is available. This hotfix addresses an issue with building trusted certificate chains.
Cloudflare One Client for Linux
A new GA release of Cloudflare One Client for Linux is now available. This hotfix addresses an issue with building trusted certificate chains.