How to use the Kinesis function from aws-sdk

Find comprehensive JavaScript aws-sdk.Kinesis code examples handpicked from public code repositorys.

52
53
54
55
56
57
58
59
60
(after [configuring the SDK](http://docs.aws.amazon.com/AWSJavaScriptSDK/guide/node-configuring.html)):

```js
var AWS = require('aws-sdk')

var kinesis = new AWS.Kinesis({endpoint: 'http://localhost:4567'})

kinesis.listStreams(console.log.bind(console))
```
fork icon93
star icon792
watch icon24

8
9
10
11
12
13
14
15
16
17
  console.log('no streamName. Specify --name param')
  return false
}

function putRecords() {
  const kinesis = new AWS.Kinesis({region: AWS_REGION})
  const params = {
    Records: Array.from(Array(parseInt(numberOfEvents))).map((_, i) => {
      const n = (Math.random() * 100).toFixed(2) * (Math.random() > 0.5 ? 1 : -1);
      console.log("amount: ", n);
fork icon52
star icon183
watch icon16

2
3
4
5
6
7
8
9
10
11
var AWS = require('aws-sdk');
var memoize = require('./lib/util/memoizeWithOptions');
var promisifyAll = require('./lib/util/promisifyAll');

function kinesis(options) {
  return promisifyAll(new AWS.Kinesis(options));
}

/**
 * Returns an instance of AWS.Kinesis which has Promise methods
fork icon10
star icon26
watch icon8

34
35
36
37
38
39
40
41
42
43
const recordsNumber = process.env.RECORDS_NUMBER;
const interval = process.env.INTERVAL;
const percentage = process.env.ANOMALOUS_PERCENTAGE;
const region = process.env.AWS_REGION;
const AWS = require('aws-sdk');
const kinesis = new AWS.Kinesis({region: region});


exports.handler = async (event) => {
    for(let batch = 1; batch <= batches; batch++) {
fork icon3
star icon7
watch icon18

55
56
57
58
59
60
61
62
63
64
exports.destinationRegex = /^([a-zA-Z0-9_-]{1,128})$/;

//********
// This function creates an instance of an Amazon Kinesis service
exports.create = function(target, options) {
  var service = new AWS.Kinesis(options);
  if(config.debug) {
    console.log("Created new AWS.Kinesis service instance");
  }
  return service;
fork icon64
star icon0
watch icon16