Sample code written in JavaScript to demonstrate streaming events (publish) from any source to Kinesis. The subscriber can be another client, or StreamSets.
Install all required dependencies.
$ yarn install
# Required for nf
$ yarn global add foreman
You need the AWS_ACCESS_KEY_ID
and AWS_SECRET_ACCESS_KEY
to run this.
$ touch .env
Your .env
should contain the following:
AWS_ACCESS_KEY_ID=<your_aws_access_key_id>
AWS_SECRET_ACCESS_KEY=<your_aws_secret_access_key>
Create a Kinesis Stream and get the Stream Name
.
At your IAM
, create a new User
with the minimum policy:
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [
"kinesis:*"
],
"Resource": [
"arn:aws:kinesis:ap-southeast-1:*:stream/<your-stream-name>"
]
}
]
}
$ nf start