From 07ca2510fdbf37ee12e6817f48e3045c7d698a37 Mon Sep 17 00:00:00 2001 From: Phil Leggetter Date: Thu, 9 May 2024 09:16:17 -0500 Subject: [PATCH] chore: add full example using variables (#59) * chore: add full example using variables * chore: after go geneate --- examples/full/init.sh | 4 +++ examples/full/main.tf | 45 ++++++++++++++++++++++++++++++++++ examples/full/terraform.tfvars | 13 ++++++++++ 3 files changed, 62 insertions(+) create mode 100755 examples/full/init.sh create mode 100644 examples/full/main.tf create mode 100644 examples/full/terraform.tfvars diff --git a/examples/full/init.sh b/examples/full/init.sh new file mode 100755 index 0000000..d0a1b90 --- /dev/null +++ b/examples/full/init.sh @@ -0,0 +1,4 @@ +#!/bin/sh + +terraform init +terraform plan \ No newline at end of file diff --git a/examples/full/main.tf b/examples/full/main.tf new file mode 100644 index 0000000..f6dd715 --- /dev/null +++ b/examples/full/main.tf @@ -0,0 +1,45 @@ +variable "HOOKDECK_API_KEY" { + type = string +} + +variable "HEADER_FILTER_VALUES" { + type = list(string) +} + +terraform { + required_providers { + hookdeck = { + source = "hookdeck/hookdeck" + version = "~> 0.3.1" + } + } +} + +provider "hookdeck" { + api_key = var.HOOKDECK_API_KEY +} + +resource "hookdeck_source" "my_source" { + name = "my_source" +} + +resource "hookdeck_destination" "my_destination" { + name = "my_destination" + url = "https://mock.hookdeck.com" +} + +resource "hookdeck_connection" "my_connection" { + source_id = hookdeck_source.my_source.id + destination_id = hookdeck_destination.my_destination.id + rules = [ + { + filter_rule = { + headers = { + json = jsonencode({ + x-event-type = { "$or" : var.HEADER_FILTER_VALUES } + }) + } + } + } + ] +} \ No newline at end of file diff --git a/examples/full/terraform.tfvars b/examples/full/terraform.tfvars new file mode 100644 index 0000000..eda518e --- /dev/null +++ b/examples/full/terraform.tfvars @@ -0,0 +1,13 @@ +HOOKDECK_API_KEY = "" + +HEADER_FILTER_VALUES = [ + "account.created.v1", + "transaction.cancelled.v1", + "transaction.pending.v1", + "transaction.processed.v1", + "account.updated.v2", + "account.deposit_started.v1", + "account.deposit_updated.v1", + "account.funds_invested.v1", + "account.funds_redeemed.v1", +] \ No newline at end of file