From 78faa23ccb0b70e32bf99720e556676a721266af Mon Sep 17 00:00:00 2001 From: Alex Luong Date: Sat, 4 May 2024 13:29:56 +0700 Subject: [PATCH] docs: Update connection filter example with better explanation on the syntax (#46) --- docs/resources/connection.md | 8 ++++++++ examples/resources/hookdeck_connection/resource.tf | 8 ++++++++ 2 files changed, 16 insertions(+) diff --git a/docs/resources/connection.md b/docs/resources/connection.md index 6393e53..1c633bf 100644 --- a/docs/resources/connection.md +++ b/docs/resources/connection.md @@ -27,9 +27,17 @@ resource "hookdeck_connection" "connection_example" { { filter_rule = { body = { + # you can use a file for the filter JSON json = file("${path.module}/filter_body.json") } + headers = { + # or use Terraform's `jsonencode` to inline the JSON + json = jsonencode({ + authorization = "my_super_secret_key" + }) + } path = { + # or match with a `string`, `number`, or `boolean` value string = "/api/webhook" } } diff --git a/examples/resources/hookdeck_connection/resource.tf b/examples/resources/hookdeck_connection/resource.tf index a85e8fd..7413c22 100644 --- a/examples/resources/hookdeck_connection/resource.tf +++ b/examples/resources/hookdeck_connection/resource.tf @@ -12,9 +12,17 @@ resource "hookdeck_connection" "connection_example" { { filter_rule = { body = { + # you can use a file for the filter JSON json = file("${path.module}/filter_body.json") } + headers = { + # or use Terraform's `jsonencode` to inline the JSON + json = jsonencode({ + authorization = "my_super_secret_key" + }) + } path = { + # or match with a `string`, `number`, or `boolean` value string = "/api/webhook" } }