Skip to content

Commit 07ca251

Browse files
authored
chore: add full example using variables (#59)
* chore: add full example using variables * chore: after go geneate
1 parent 83de35e commit 07ca251

File tree

3 files changed

+62
-0
lines changed

3 files changed

+62
-0
lines changed

examples/full/init.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/bin/sh
2+
3+
terraform init
4+
terraform plan

examples/full/main.tf

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
variable "HOOKDECK_API_KEY" {
2+
type = string
3+
}
4+
5+
variable "HEADER_FILTER_VALUES" {
6+
type = list(string)
7+
}
8+
9+
terraform {
10+
required_providers {
11+
hookdeck = {
12+
source = "hookdeck/hookdeck"
13+
version = "~> 0.3.1"
14+
}
15+
}
16+
}
17+
18+
provider "hookdeck" {
19+
api_key = var.HOOKDECK_API_KEY
20+
}
21+
22+
resource "hookdeck_source" "my_source" {
23+
name = "my_source"
24+
}
25+
26+
resource "hookdeck_destination" "my_destination" {
27+
name = "my_destination"
28+
url = "https://mock.hookdeck.com"
29+
}
30+
31+
resource "hookdeck_connection" "my_connection" {
32+
source_id = hookdeck_source.my_source.id
33+
destination_id = hookdeck_destination.my_destination.id
34+
rules = [
35+
{
36+
filter_rule = {
37+
headers = {
38+
json = jsonencode({
39+
x-event-type = { "$or" : var.HEADER_FILTER_VALUES }
40+
})
41+
}
42+
}
43+
}
44+
]
45+
}

examples/full/terraform.tfvars

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
HOOKDECK_API_KEY = "<YOUR_HOOKDECK_API_KEY>"
2+
3+
HEADER_FILTER_VALUES = [
4+
"account.created.v1",
5+
"transaction.cancelled.v1",
6+
"transaction.pending.v1",
7+
"transaction.processed.v1",
8+
"account.updated.v2",
9+
"account.deposit_started.v1",
10+
"account.deposit_updated.v1",
11+
"account.funds_invested.v1",
12+
"account.funds_redeemed.v1",
13+
]

0 commit comments

Comments
 (0)