Skip to content

Commit bc8c613

Browse files
authored
Merge pull request #1390 from ogghead/spin_kinesis
Add spin kinesis trigger plugin info
2 parents 87aa15c + b5945d1 commit bc8c613

File tree

1 file changed

+77
-0
lines changed

1 file changed

+77
-0
lines changed
Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
title = "Kinesis Trigger"
2+
template = "render_hub_content_body"
3+
date = "2024-10-04T00:22:56Z"
4+
content-type = "text/plain"
5+
tags = ["trigger", "rust", "plugins"]
6+
7+
[extra]
8+
author = "ogghead"
9+
type = "hub_document"
10+
category = "Plugin"
11+
language = "Rust"
12+
created_at = "2024-08-31T00:22:56Z"
13+
last_updated = "2024-10-04T00:22:56Z"
14+
spin_version = ">=v2.6.0"
15+
summary = "An experimental Kinesis trigger for Spin apps"
16+
url = "https://github.com/ogghead/spin-trigger-kinesis"
17+
keywords = "trigger, kinesis"
18+
19+
---
20+
21+
An experimental plugin that enables AWS Kinesis trigger for Spin applications.
22+
23+
## Installing Plugin
24+
25+
You can install the plugin using the following command:
26+
27+
```sh
28+
spin plugins install --url https://github.com/ogghead/spin-trigger-kinesis/releases/download/canary/trigger-kinesis.json
29+
```
30+
31+
## Installing Template
32+
33+
You can install the template using the following command:
34+
35+
```sh
36+
spin templates install --update --git https://github.com/ogghead/spin-trigger-kinesis
37+
```
38+
39+
Once the template is installed, you can create a new application using:
40+
41+
```sh
42+
spin new -t kinesis-rust hello_kinesis --accept-defaults
43+
```
44+
45+
Note that you will need to provide a valid ARN (Amazon Resource Name) for your stream.
46+
47+
To run the newly created app:
48+
49+
```bash
50+
cd hello_kinesis
51+
spin build --up
52+
```
53+
54+
### Configuring the Kinesis Trigger
55+
56+
The trigger type is `kinesis` and there are no application-level configuration options.
57+
58+
The following options are available to set in the [[trigger.kinesis]] section:
59+
60+
| Name | Type | Required? | Description |
61+
|-----------------------------|------------------|-----------|-------------|
62+
| `stream_arn` | string | required | The stream to which this trigger listens and responds. |
63+
| `batch_size` | number | optional | The maximum number of records to fetch per Kinesis shard on each poll. The default is 10. This directly affects the amount of records that your component is invoked with. |
64+
| `shard_idle_wait_millis` | number | optional | How long (in milliseconds) to wait between checks when the stream is idle (i.e. when no messages were received on the last check). The default is 1000. If the stream is _not_ idle, there is no wait between checks. The idle wait is also applied if an error occurs. Note that this number should _not_ exceed 300,000 milliseconds (5 minutes), as shard iterators time out after this period |
65+
| `detector_poll_millis` | number | optional | How long (in milliseconds) to wait between checks for new shards. The default is 30,000 (30 seconds). |
66+
| `shard_iterator_type` | enum | optional | See <https://docs.aws.amazon.com/cli/latest/reference/kinesis/get-shard-iterator.html#options> for possible options. Defaults to LATEST. |
67+
| `component` | string or table | required | The component to run when a stream record is received. This is the standard Spin trigger component field. |
68+
69+
```toml
70+
[[trigger.kinesis]]
71+
component = "test"
72+
stream_arn = "arn:aws:kinesis:us-east-1:1234567890:stream/TestStream"
73+
batch_size = 1000
74+
shard_idle_wait_millis = 250
75+
detector_poll_millis = 30000
76+
shard_iterator_type = "TRIM_HORIZON"
77+
```

0 commit comments

Comments
 (0)