Class: AWS.DynamoDBStreams

Inherits:
AWS.Service show all
Identifier:
dynamodbstreams
API Version:
2012-08-10
Defined in:
(unknown)

Overview

Constructs a service interface object. Each API operation is exposed as a function on service.

Sending a Request Using DynamoDBStreams

var dynamodbstreams = new AWS.DynamoDBStreams();
dynamodbstreams.describeStream(params, function (err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Locking the API Version

In order to ensure that the DynamoDBStreams object uses this specific API, you can construct the object by passing the apiVersion option to the constructor:

var dynamodbstreams = new AWS.DynamoDBStreams({apiVersion: '2012-08-10'});

You can also set the API version globally in AWS.config.apiVersions using the dynamodbstreams service identifier:

AWS.config.apiVersions = {
  dynamodbstreams: '2012-08-10',
  // other service API versions
};

var dynamodbstreams = new AWS.DynamoDBStreams();

Version:

  • 2012-08-10

Constructor Summary collapse

Property Summary collapse

Properties inherited from AWS.Service

apiVersions

Method Summary collapse

Methods inherited from AWS.Service

makeRequest, makeUnauthenticatedRequest, waitFor, setupRequestListeners, defineService

Constructor Details

new AWS.DynamoDBStreams(options = {}) ⇒ Object

Constructs a service object. This object has one method for each API operation.

Examples:

Constructing a DynamoDBStreams object

var dynamodbstreams = new AWS.DynamoDBStreams({apiVersion: '2012-08-10'});

Options Hash (options):

  • params (map)

    An optional map of parameters to bind to every request sent by this service object. For more information on bound parameters, see "Working with Services" in the Getting Started Guide.

  • endpoint (String)

    The endpoint URI to send requests to. The default endpoint is built from the configured region. The endpoint should be a string like 'https://{service}.{region}.amazonaws.com'.

  • accessKeyId (String)

    your AWS access key ID.

  • secretAccessKey (String)

    your AWS secret access key.

  • sessionToken (AWS.Credentials)

    the optional AWS session token to sign requests with.

  • credentials (AWS.Credentials)

    the AWS credentials to sign requests with. You can either specify this object, or specify the accessKeyId and secretAccessKey options directly.

  • credentialProvider (AWS.CredentialProviderChain)

    the provider chain used to resolve credentials if no static credentials property is set.

  • region (String)

    the region to send service requests to. See AWS.DynamoDBStreams.region for more information.

  • maxRetries (Integer)

    the maximum amount of retries to attempt with a request. See AWS.DynamoDBStreams.maxRetries for more information.

  • maxRedirects (Integer)

    the maximum amount of redirects to follow with a request. See AWS.DynamoDBStreams.maxRedirects for more information.

  • sslEnabled (Boolean)

    whether to enable SSL for requests.

  • paramValidation (Boolean|map)

    whether input parameters should be validated against the operation description before sending the request. Defaults to true. Pass a map to enable any of the following specific validation features:

    • min [Boolean] — Validates that a value meets the min constraint. This is enabled by default when paramValidation is set to true.
    • max [Boolean] — Validates that a value meets the max constraint.
    • pattern [Boolean] — Validates that a string value matches a regular expression.
    • enum [Boolean] — Validates that a string value matches one of the allowable enum values.
  • computeChecksums (Boolean)

    whether to compute checksums for payload bodies when the service accepts it (currently supported in S3 only)

  • convertResponseTypes (Boolean)

    whether types are converted when parsing response data. Currently only supported for JSON based services. Turning this off may improve performance on large response payloads. Defaults to true.

  • correctClockSkew (Boolean)

    whether to apply a clock skew correction and retry requests that fail because of an skewed client clock. Defaults to false.

  • s3ForcePathStyle (Boolean)

    whether to force path style URLs for S3 objects.

  • s3BucketEndpoint (Boolean)

    whether the provided endpoint addresses an individual bucket (false if it addresses the root API endpoint). Note that setting this configuration option requires an endpoint to be provided explicitly to the service constructor.

  • s3DisableBodySigning (Boolean)

    whether S3 body signing should be disabled when using signature version v4. Body signing can only be disabled when using https. Defaults to true.

  • retryDelayOptions (map)

    A set of options to configure the retry delay on retryable errors. Currently supported options are:

    • base [Integer] — The base number of milliseconds to use in the exponential backoff for operation retries. Defaults to 100 ms for all services accept DynamoDB, where it defaults to 50ms.
    • customBackoff [function] — A custom function that accepts a retry count and returns the amount of time to delay in milliseconds. The base option will be ignored if this option is supplied.
  • httpOptions (map)

    A set of options to pass to the low-level HTTP request. Currently supported options are:

    • proxy [String] — the URL to proxy requests through
    • agent [http.Agent, https.Agent] — the Agent object to perform HTTP requests with. Used for connection pooling. Defaults to the global agent (http.globalAgent) for non-SSL connections. Note that for SSL connections, a special Agent object is used in order to enable peer certificate verification. This feature is only available in the Node.js environment.
    • connectTimeout [Integer] — Sets the socket to timeout after failing to establish a connection with the server after connectTimeout milliseconds. This timeout has no effect once a socket connection has been established.
    • timeout [Integer] — Sets the socket to timeout after timeout milliseconds of inactivity on the socket. Defaults to two minutes (120000).
    • xhrAsync [Boolean] — Whether the SDK will send asynchronous HTTP requests. Used in the browser environment only. Set to false to send requests synchronously. Defaults to true (async on).
    • xhrWithCredentials [Boolean] — Sets the "withCredentials" property of an XMLHttpRequest object. Used in the browser environment only. Defaults to false.
  • apiVersion (String, Date)

    a String in YYYY-MM-DD format (or a date) that represents the latest possible API version that can be used in all services (unless overridden by apiVersions). Specify 'latest' to use the latest possible version.

  • apiVersions (map<String, String|Date>)

    a map of service identifiers (the lowercase service class name) with the API version to use when instantiating a service. Specify 'latest' for each individual that can use the latest available version.

  • logger (#write, #log)

    an object that responds to .write() (like a stream) or .log() (like the console object) in order to log information about requests

  • systemClockOffset (Number)

    an offset value in milliseconds to apply to all signing times. Use this to compensate for clock skew when your system may be out of sync with the service time. Note that this configuration option can only be applied to the global AWS.config object and cannot be overridden in service-specific configuration. Defaults to 0 milliseconds.

  • signatureVersion (String)

    the signature version to sign requests with (overriding the API configuration). Possible values are: 'v2', 'v3', 'v4'.

  • signatureCache (Boolean)

    whether the signature to sign requests with (overriding the API configuration) is cached. Only applies to the signature version 'v4'. Defaults to true.

Property Details

endpointAWS.Endpoint (readwrite)

Returns an Endpoint object representing the endpoint URL for service requests.

Returns:

  • (AWS.Endpoint)

    an Endpoint object representing the endpoint URL for service requests.

Method Details

describeStream(params = {}, callback) ⇒ AWS.Request

Returns information about a stream, including the current status of the stream, its Amazon Resource Name (ARN), the composition of its shards, and its corresponding DynamoDB table.

Note: You can call DescribeStream at a maximum rate of 10 times per second.

Each shard in the stream has a SequenceNumberRange associated with it. If the SequenceNumberRange has a StartingSequenceNumber but no EndingSequenceNumber, then the shard is still open (able to receive more stream records). If both StartingSequenceNumber and EndingSequenceNumber are present, then that shard is closed and can no longer receive more data.

Service Reference:

Examples:

To describe a stream with a given stream ARN


/* The following example describes a stream with a given stream ARN. */

 var params = {
  StreamArn: "arn:aws:dynamodb:us-west-2:111122223333:table/Forum/stream/2015-05-20T20:51:10.252"
 };
 dynamodbstreams.describeStream(params, function(err, data) {
   if (err) console.log(err, err.stack); // an error occurred
   else     console.log(data);           // successful response
   /*
   data = {
    StreamDescription: {
     CreationRequestDateTime: <Date Representation>, 
     KeySchema: [
        {
       AttributeName: "ForumName", 
       KeyType: "HASH"
      }, 
        {
       AttributeName: "Subject", 
       KeyType: "RANGE"
      }
     ], 
     Shards: [
        {
       SequenceNumberRange: {
        EndingSequenceNumber: "20500000000000000910398", 
        StartingSequenceNumber: "20500000000000000910398"
       }, 
       ShardId: "shardId-00000001414562045508-2bac9cd2"
      }, 
        {
       ParentShardId: "shardId-00000001414562045508-2bac9cd2", 
       SequenceNumberRange: {
        EndingSequenceNumber: "820400000000000001192334", 
        StartingSequenceNumber: "820400000000000001192334"
       }, 
       ShardId: "shardId-00000001414576573621-f55eea83"
      }, 
        {
       ParentShardId: "shardId-00000001414576573621-f55eea83", 
       SequenceNumberRange: {
        EndingSequenceNumber: "1683700000000000001135967", 
        StartingSequenceNumber: "1683700000000000001135967"
       }, 
       ShardId: "shardId-00000001414592258131-674fd923"
      }, 
        {
       ParentShardId: "shardId-00000001414592258131-674fd923", 
       SequenceNumberRange: {
        StartingSequenceNumber: "2574600000000000000935255"
       }, 
       ShardId: "shardId-00000001414608446368-3a1afbaf"
      }
     ], 
     StreamArn: "arn:aws:dynamodb:us-west-2:111122223333:table/Forum/stream/2015-05-20T20:51:10.252", 
     StreamLabel: "2015-05-20T20:51:10.252", 
     StreamStatus: "ENABLED", 
     StreamViewType: "NEW_AND_OLD_IMAGES", 
     TableName: "Forum"
    }
   }
   */
 });

Calling the describeStream operation

var params = {
  StreamArn: 'STRING_VALUE', /* required */
  ExclusiveStartShardId: 'STRING_VALUE',
  Limit: 0
};
dynamodbstreams.describeStream(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • StreamArn — (String)

      The Amazon Resource Name (ARN) for the stream.

    • Limit — (Integer)

      The maximum number of shard objects to return. The upper limit is 100.

    • ExclusiveStartShardId — (String)

      The shard ID of the first item that this operation will evaluate. Use the value that was returned for LastEvaluatedShardId in the previous operation.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • StreamDescription — (map)

        A complete description of the stream, including its creation date and time, the DynamoDB table associated with the stream, the shard IDs within the stream, and the beginning and ending sequence numbers of stream records within the shards.

        • StreamArn — (String)

          The Amazon Resource Name (ARN) for the stream.

        • StreamLabel — (String)

          A timestamp, in ISO 8601 format, for this stream.

          Note that LatestStreamLabel is not a unique identifier for the stream, because it is possible that a stream from another table might have the same timestamp. However, the combination of the following three elements is guaranteed to be unique:

          • the AWS customer ID.

          • the table name

          • the StreamLabel

        • StreamStatus — (String)

          Indicates the current status of the stream:

          • ENABLING - Streams is currently being enabled on the DynamoDB table.

          • ENABLED - the stream is enabled.

          • DISABLING - Streams is currently being disabled on the DynamoDB table.

          • DISABLED - the stream is disabled.

          Possible values include:
          • "ENABLING"
          • "ENABLED"
          • "DISABLING"
          • "DISABLED"
        • StreamViewType — (String)

          Indicates the format of the records within this stream:

          • KEYS_ONLY - only the key attributes of items that were modified in the DynamoDB table.

          • NEW_IMAGE - entire items from the table, as they appeared after they were modified.

          • OLD_IMAGE - entire items from the table, as they appeared before they were modified.

          • NEW_AND_OLD_IMAGES - both the new and the old images of the items from the table.

          Possible values include:
          • "NEW_IMAGE"
          • "OLD_IMAGE"
          • "NEW_AND_OLD_IMAGES"
          • "KEYS_ONLY"
        • CreationRequestDateTime — (Date)

          The date and time when the request to create this stream was issued.

        • TableName — (String)

          The DynamoDB table with which the stream is associated.

        • KeySchema — (Array<map>)

          The key attribute(s) of the stream's DynamoDB table.

          • AttributeNamerequired — (String)

            The name of a key attribute.

          • KeyTyperequired — (String)

            The attribute data, consisting of the data type and the attribute value itself.

            Possible values include:
            • "HASH"
            • "RANGE"
        • Shards — (Array<map>)

          The shards that comprise the stream.

          • ShardId — (String)

            The system-generated identifier for this shard.

          • SequenceNumberRange — (map)

            The range of possible sequence numbers for the shard.

            • StartingSequenceNumber — (String)

              The first sequence number.

            • EndingSequenceNumber — (String)

              The last sequence number.

          • ParentShardId — (String)

            The shard ID of the current shard's parent.

        • LastEvaluatedShardId — (String)

          The shard ID of the item where the operation stopped, inclusive of the previous result set. Use this value to start a new operation, excluding this value in the new request.

          If LastEvaluatedShardId is empty, then the "last page" of results has been processed and there is currently no more data to be retrieved.

          If LastEvaluatedShardId is not empty, it does not necessarily mean that there is more data in the result set. The only way to know when you have reached the end of the result set is when LastEvaluatedShardId is empty.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

getRecords(params = {}, callback) ⇒ AWS.Request

Retrieves the stream records from a given shard.

Specify a shard iterator using the ShardIterator parameter. The shard iterator specifies the position in the shard from which you want to start reading stream records sequentially. If there are no stream records available in the portion of the shard that the iterator points to, GetRecords returns an empty list. Note that it might take multiple calls to get to a portion of the shard that contains stream records.

Note: GetRecords can retrieve a maximum of 1 MB of data or 1000 stream records, whichever comes first.

Service Reference:

Examples:

To retrieve all the stream records from a shard


/* The following example retrieves all the stream records from a shard. */

 var params = {
  ShardIterator: "arn:aws:dynamodb:us-west-2:111122223333:table/Forum/stream/2015-05-20T20:51:10.252|1|AAAAAAAAAAEvJp6D+zaQ...  <remaining characters omitted> ..."
 };
 dynamodbstreams.getRecords(params, function(err, data) {
   if (err) console.log(err, err.stack); // an error occurred
   else     console.log(data);           // successful response
   /*
   data = {
    NextShardIterator: "arn:aws:dynamodb:us-west-2:111122223333:table/Forum/stream/2015-05-20T20:51:10.252|1|AAAAAAAAAAGQBYshYDEe ... <remaining characters omitted> ...", 
    Records: [
       {
      awsRegion: "us-west-2", 
      dynamodb: {
       ApproximateCreationDateTime: <Date Representation>, 
       Keys: {
        "ForumName": {
          S: "DynamoDB"
         }, 
        "Subject": {
          S: "DynamoDB Thread 3"
         }
       }, 
       SequenceNumber: "300000000000000499659", 
       SizeBytes: 41, 
       StreamViewType: "KEYS_ONLY"
      }, 
      eventID: "e2fd9c34eff2d779b297b26f5fef4206", 
      eventName: "INSERT", 
      eventSource: "aws:dynamodb", 
      eventVersion: "1.0"
     }, 
       {
      awsRegion: "us-west-2", 
      dynamodb: {
       ApproximateCreationDateTime: <Date Representation>, 
       Keys: {
        "ForumName": {
          S: "DynamoDB"
         }, 
        "Subject": {
          S: "DynamoDB Thread 1"
         }
       }, 
       SequenceNumber: "400000000000000499660", 
       SizeBytes: 41, 
       StreamViewType: "KEYS_ONLY"
      }, 
      eventID: "4b25bd0da9a181a155114127e4837252", 
      eventName: "MODIFY", 
      eventSource: "aws:dynamodb", 
      eventVersion: "1.0"
     }, 
       {
      awsRegion: "us-west-2", 
      dynamodb: {
       ApproximateCreationDateTime: <Date Representation>, 
       Keys: {
        "ForumName": {
          S: "DynamoDB"
         }, 
        "Subject": {
          S: "DynamoDB Thread 2"
         }
       }, 
       SequenceNumber: "500000000000000499661", 
       SizeBytes: 41, 
       StreamViewType: "KEYS_ONLY"
      }, 
      eventID: "740280c73a3df7842edab3548a1b08ad", 
      eventName: "REMOVE", 
      eventSource: "aws:dynamodb", 
      eventVersion: "1.0"
     }
    ]
   }
   */
 });

Calling the getRecords operation

var params = {
  ShardIterator: 'STRING_VALUE', /* required */
  Limit: 0
};
dynamodbstreams.getRecords(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • ShardIterator — (String)

      A shard iterator that was retrieved from a previous GetShardIterator operation. This iterator can be used to access the stream records in this shard.

    • Limit — (Integer)

      The maximum number of records to return from the shard. The upper limit is 1000.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • Records — (Array<map>)

        The stream records from the shard, which were retrieved using the shard iterator.

        • eventID — (String)

          A globally unique identifier for the event that was recorded in this stream record.

        • eventName — (String)

          The type of data modification that was performed on the DynamoDB table:

          • INSERT - a new item was added to the table.

          • MODIFY - one or more of an existing item's attributes were modified.

          • REMOVE - the item was deleted from the table

          Possible values include:
          • "INSERT"
          • "MODIFY"
          • "REMOVE"
        • eventVersion — (String)

          The version number of the stream record format. This number is updated whenever the structure of Record is modified.

          Client applications must not assume that eventVersion will remain at a particular value, as this number is subject to change at any time. In general, eventVersion will only increase as the low-level DynamoDB Streams API evolves.

        • eventSource — (String)

          The AWS service from which the stream record originated. For DynamoDB Streams, this is aws:dynamodb.

        • awsRegion — (String)

          The region in which the GetRecords request was received.

        • dynamodb — (map)

          The main body of the stream record, containing all of the DynamoDB-specific fields.

          • ApproximateCreationDateTime — (Date)

            The approximate date and time when the stream record was created, in UNIX epoch time format.

          • Keys — (map<map>)

            The primary key attribute(s) for the DynamoDB item that was modified.

            • S — (String)

              A String data type.

            • N — (String)

              A Number data type.

            • B — (Buffer, Typed Array, Blob, String)

              A Binary data type.

            • SS — (Array<String>)

              A String Set data type.

            • NS — (Array<String>)

              A Number Set data type.

            • BS — (Array<Buffer, Typed Array, Blob, String>)

              A Binary Set data type.

            • M — (map<map>)

              A Map data type.

            • L — (Array<map>)

              A List data type.

            • NULL — (Boolean)

              A Null data type.

            • BOOL — (Boolean)

              A Boolean data type.

          • NewImage — (map<map>)

            The item in the DynamoDB table as it appeared after it was modified.

            • S — (String)

              A String data type.

            • N — (String)

              A Number data type.

            • B — (Buffer, Typed Array, Blob, String)

              A Binary data type.

            • SS — (Array<String>)

              A String Set data type.

            • NS — (Array<String>)

              A Number Set data type.

            • BS — (Array<Buffer, Typed Array, Blob, String>)

              A Binary Set data type.

            • M — (map<map>)

              A Map data type.

            • L — (Array<map>)

              A List data type.

            • NULL — (Boolean)

              A Null data type.

            • BOOL — (Boolean)

              A Boolean data type.

          • OldImage — (map<map>)

            The item in the DynamoDB table as it appeared before it was modified.

            • S — (String)

              A String data type.

            • N — (String)

              A Number data type.

            • B — (Buffer, Typed Array, Blob, String)

              A Binary data type.

            • SS — (Array<String>)

              A String Set data type.

            • NS — (Array<String>)

              A Number Set data type.

            • BS — (Array<Buffer, Typed Array, Blob, String>)

              A Binary Set data type.

            • M — (map<map>)

              A Map data type.

            • L — (Array<map>)

              A List data type.

            • NULL — (Boolean)

              A Null data type.

            • BOOL — (Boolean)

              A Boolean data type.

          • SequenceNumber — (String)

            The sequence number of the stream record.

          • SizeBytes — (Integer)

            The size of the stream record, in bytes.

          • StreamViewType — (String)

            The type of data from the modified DynamoDB item that was captured in this stream record:

            • KEYS_ONLY - only the key attributes of the modified item.

            • NEW_IMAGE - the entire item, as it appeared after it was modified.

            • OLD_IMAGE - the entire item, as it appeared before it was modified.

            • NEW_AND_OLD_IMAGES - both the new and the old item images of the item.

            Possible values include:
            • "NEW_IMAGE"
            • "OLD_IMAGE"
            • "NEW_AND_OLD_IMAGES"
            • "KEYS_ONLY"
        • userIdentity — (map)

          Items that are deleted by the Time to Live process after expiration have the following fields:

          • Records[].userIdentity.type

            "Service"

          • Records[].userIdentity.principalId

            "dynamodb.amazonaws.com"

          • PrincipalId — (String)

            A unique identifier for the entity that made the call. For Time To Live, the principalId is "dynamodb.amazonaws.com".

          • Type — (String)

            The type of the identity. For Time To Live, the type is "Service".

      • NextShardIterator — (String)

        The next position in the shard from which to start sequentially reading stream records. If set to null, the shard has been closed and the requested iterator will not return any more data.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

getShardIterator(params = {}, callback) ⇒ AWS.Request

Returns a shard iterator. A shard iterator provides information about how to retrieve the stream records from within a shard. Use the shard iterator in a subsequent GetRecords request to read the stream records from the shard.

Note: A shard iterator expires 15 minutes after it is returned to the requester.

Service Reference:

Examples:

To obtain a shard iterator for the provided stream ARN and shard ID


/* The following example returns a shard iterator for the provided stream ARN and shard ID. */

 var params = {
  ShardId: "00000001414576573621-f55eea83", 
  ShardIteratorType: "TRIM_HORIZON", 
  StreamArn: "arn:aws:dynamodb:us-west-2:111122223333:table/Forum/stream/2015-05-20T20:51:10.252"
 };
 dynamodbstreams.getShardIterator(params, function(err, data) {
   if (err) console.log(err, err.stack); // an error occurred
   else     console.log(data);           // successful response
   /*
   data = {
    ShardIterator: "arn:aws:dynamodb:us-west-2:111122223333:table/Forum/stream/2015-05-20T20:51:10.252|1|AAAAAAAAAAEvJp6D+zaQ...  <remaining characters omitted> ..."
   }
   */
 });

Calling the getShardIterator operation

var params = {
  ShardId: 'STRING_VALUE', /* required */
  ShardIteratorType: TRIM_HORIZON | LATEST | AT_SEQUENCE_NUMBER | AFTER_SEQUENCE_NUMBER, /* required */
  StreamArn: 'STRING_VALUE', /* required */
  SequenceNumber: 'STRING_VALUE'
};
dynamodbstreams.getShardIterator(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • StreamArn — (String)

      The Amazon Resource Name (ARN) for the stream.

    • ShardId — (String)

      The identifier of the shard. The iterator will be returned for this shard ID.

    • ShardIteratorType — (String)

      Determines how the shard iterator is used to start reading stream records from the shard:

      • AT_SEQUENCE_NUMBER - Start reading exactly from the position denoted by a specific sequence number.

      • AFTER_SEQUENCE_NUMBER - Start reading right after the position denoted by a specific sequence number.

      • TRIM_HORIZON - Start reading at the last (untrimmed) stream record, which is the oldest record in the shard. In DynamoDB Streams, there is a 24 hour limit on data retention. Stream records whose age exceeds this limit are subject to removal (trimming) from the stream.

      • LATEST - Start reading just after the most recent stream record in the shard, so that you always read the most recent data in the shard.

      Possible values include:
      • "TRIM_HORIZON"
      • "LATEST"
      • "AT_SEQUENCE_NUMBER"
      • "AFTER_SEQUENCE_NUMBER"
    • SequenceNumber — (String)

      The sequence number of a stream record in the shard from which to start reading.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • ShardIterator — (String)

        The position in the shard from which to start reading stream records sequentially. A shard iterator specifies this position using the sequence number of a stream record in a shard.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

listStreams(params = {}, callback) ⇒ AWS.Request

Returns an array of stream ARNs associated with the current account and endpoint. If the TableName parameter is present, then ListStreams will return only the streams ARNs for that table.

Note: You can call ListStreams at a maximum rate of 5 times per second.

Service Reference:

Examples:

To list all of the stream ARNs


/* The following example lists all of the stream ARNs. */

 var params = {
 };
 dynamodbstreams.listStreams(params, function(err, data) {
   if (err) console.log(err, err.stack); // an error occurred
   else     console.log(data);           // successful response
   /*
   data = {
    Streams: [
       {
      StreamArn: "arn:aws:dynamodb:us-wesst-2:111122223333:table/Forum/stream/2015-05-20T20:51:10.252", 
      StreamLabel: "2015-05-20T20:51:10.252", 
      TableName: "Forum"
     }, 
       {
      StreamArn: "arn:aws:dynamodb:us-west-2:111122223333:table/Forum/stream/2015-05-20T20:50:02.714", 
      StreamLabel: "2015-05-20T20:50:02.714", 
      TableName: "Forum"
     }, 
       {
      StreamArn: "arn:aws:dynamodb:us-west-2:111122223333:table/Forum/stream/2015-05-19T23:03:50.641", 
      StreamLabel: "2015-05-19T23:03:50.641", 
      TableName: "Forum"
     }
    ]
   }
   */
 });

Calling the listStreams operation

var params = {
  ExclusiveStartStreamArn: 'STRING_VALUE',
  Limit: 0,
  TableName: 'STRING_VALUE'
};
dynamodbstreams.listStreams(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • TableName — (String)

      If this parameter is provided, then only the streams associated with this table name are returned.

    • Limit — (Integer)

      The maximum number of streams to return. The upper limit is 100.

    • ExclusiveStartStreamArn — (String)

      The ARN (Amazon Resource Name) of the first item that this operation will evaluate. Use the value that was returned for LastEvaluatedStreamArn in the previous operation.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • Streams — (Array<map>)

        A list of stream descriptors associated with the current account and endpoint.

        • StreamArn — (String)

          The Amazon Resource Name (ARN) for the stream.

        • TableName — (String)

          The DynamoDB table with which the stream is associated.

        • StreamLabel — (String)

          A timestamp, in ISO 8601 format, for this stream.

          Note that LatestStreamLabel is not a unique identifier for the stream, because it is possible that a stream from another table might have the same timestamp. However, the combination of the following three elements is guaranteed to be unique:

          • the AWS customer ID.

          • the table name

          • the StreamLabel

      • LastEvaluatedStreamArn — (String)

        The stream ARN of the item where the operation stopped, inclusive of the previous result set. Use this value to start a new operation, excluding this value in the new request.

        If LastEvaluatedStreamArn is empty, then the "last page" of results has been processed and there is no more data to be retrieved.

        If LastEvaluatedStreamArn is not empty, it does not necessarily mean that there is more data in the result set. The only way to know when you have reached the end of the result set is when LastEvaluatedStreamArn is empty.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.