Powered By GitBook
Terraform
Terraform is a Cloud configuration tool from Hashicorp. We maintain a Provider for Terraform called terraform-provider-jetstream that can maintain JetStream using Terraform.
Find it in the Terraform registry.

Setup

In your project you can configure the Provider like this:
1
provider "jetstream" {
2
servers = "connect.ngs.global"
3
credentials = "ngs_jetstream_admin.creds"
4
}
Copied!
Sample code below that creates the ORDERS example. Review the Project README for full details.
1
resource "jetstream_stream" "ORDERS" {
2
name = "ORDERS"
3
subjects = ["ORDERS.*"]
4
storage = "file"
5
max_age = 60 * 60 * 24 * 365
6
}
7
8
resource "jetstream_consumer" "ORDERS_NEW" {
9
stream_id = jetstream_stream.ORDERS.id
10
durable_name = "NEW"
11
deliver_all = true
12
filter_subject = "ORDERS.received"
13
sample_freq = 100
14
}
15
16
resource "jetstream_consumer" "ORDERS_DISPATCH" {
17
stream_id = jetstream_stream.ORDERS.id
18
durable_name = "DISPATCH"
19
deliver_all = true
20
filter_subject = "ORDERS.processed"
21
sample_freq = 100
22
}
23
24
resource "jetstream_consumer" "ORDERS_MONITOR" {
25
stream_id = jetstream_stream.ORDERS.id
26
durable_name = "MONITOR"
27
deliver_last = true
28
ack_policy = "none"
29
delivery_subject = "monitor.ORDERS"
30
}
31
32
output "ORDERS_SUBJECTS" {
33
value = jetstream_stream.ORDERS.subjects
34
}
Copied!
Last modified 2mo ago
Export as PDF
Copy link
Contents
Setup