Play with your AWS Kinesis stream with JavaScript.
- AWS CLI installed and your credentials set up properly.
- node
Make sure you have correct AWS profile activated.
$ export AWS_PROFILE=default
When running the below scripts, you can inject environment variables like this.
$ KINESIS_STREAM=litsynp-test-stream-dev AWS_REGION=ap-northeast-1 npm run publish-events hello 1
Push test data to stream with publish-events
.
$ npm run publish-events [data] [iteration]
data
- string data to put as record (default:Hello World!
)iteration
- the number of times you want to send the data (default:1
)
Retrieve the data you sent to the Kinesis stream.
$ npm run get-records [shard-id]
shard-id
- The ShardID. (default:0
)
For more information about AWS CLI and injecting environment variables, refer to these links: