Skip to content

Commit

Permalink
chore: add full example using variables (#59)
Browse files Browse the repository at this point in the history
* chore: add full example using variables

* chore: after go geneate
  • Loading branch information
leggetter authored May 9, 2024
1 parent 83de35e commit 07ca251
Show file tree
Hide file tree
Showing 3 changed files with 62 additions and 0 deletions.
4 changes: 4 additions & 0 deletions examples/full/init.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/sh

terraform init
terraform plan
45 changes: 45 additions & 0 deletions examples/full/main.tf
Original file line number Diff line number Diff line change
@@ -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 }
})
}
}
}
]
}
13 changes: 13 additions & 0 deletions examples/full/terraform.tfvars
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
HOOKDECK_API_KEY = "<YOUR_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",
]

0 comments on commit 07ca251

Please sign in to comment.