amazonka-dynamodb-streams-1.2.0.1: Amazon DynamoDB Streams SDK.

Copyright(c) 2013-2015 Brendan Hay
LicenseMozilla Public License, v. 2.0.
MaintainerBrendan Hay <brendan.g.hay@gmail.com>
Stabilityauto-generated
Portabilitynon-portable (GHC extensions)
Safe HaskellNone
LanguageHaskell2010

Network.AWS.DynamoDBStreams

Contents

Description

Amazon DynamoDB Streams

This is the Amazon DynamoDB Streams API Reference. This guide describes the low-level API actions for accessing streams and processing stream records. For information about application development with DynamoDB Streams, see the Amazon DynamoDB Developer Guide.

Note that this document is intended for use with the following DynamoDB documentation:

The following are short descriptions of each low-level DynamoDB Streams API action, organized by function.

  • DescribeStream - Returns detailed information about a particular stream.
  • GetRecords - Retrieves the stream records from within a shard.
  • GetShardIterator - Returns information on how to retrieve the streams record from a shard with a given shard ID.
  • ListStreams - Returns a list of all the streams associated with the current AWS account and endpoint.

See: AWS API Reference

Synopsis

Service Configuration

dynamoDBStreams :: Service Source

API version '2012-08-10' of the Amazon DynamoDB Streams SDK configuration.

Errors

Error matchers are designed for use with the functions provided by Control.Exception.Lens. This allows catching (and rethrowing) service specific errors returned by DynamoDBStreams.

ExpiredIteratorException

_ExpiredIteratorException :: AsError a => Getting (First ServiceError) a ServiceError Source

The shard iterator has expired and can no longer be used to retrieve stream records. A shard iterator expires 15 minutes after it is retrieved using the GetShardIterator action.

InternalServerError

_InternalServerError :: AsError a => Getting (First ServiceError) a ServiceError Source

An error occurred on the server side.

TrimmedDataAccessException

_TrimmedDataAccessException :: AsError a => Getting (First ServiceError) a ServiceError Source

The operation attempted to read past the oldest stream record in a 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. You might receive a TrimmedDataAccessException if:

  • You request a shard iterator with a sequence number older than the trim point (24 hours).
  • You obtain a shard iterator, but before you use the iterator in a GetRecords request, a stream record in the shard exceeds the 24 hour period and is trimmed. This causes the iterator to access a record that no longer exists.

ResourceNotFoundException

_ResourceNotFoundException :: AsError a => Getting (First ServiceError) a ServiceError Source

The operation tried to access a nonexistent stream.

LimitExceededException

_LimitExceededException :: AsError a => Getting (First ServiceError) a ServiceError Source

Your request rate is too high. The AWS SDKs for DynamoDB automatically retry requests that receive this exception. Your request is eventually successful, unless your retry queue is too large to finish. Reduce the frequency of requests and use exponential backoff. For more information, go to Error Retries and Exponential Backoff in the Amazon DynamoDB Developer Guide.

Waiters

Waiters poll by repeatedly sending a request until some remote success condition configured by the Wait specification is fulfilled. The Wait specification determines how many attempts should be made, in addition to delay and retry strategies.

Operations

Some AWS operations return results that are incomplete and require subsequent requests in order to obtain the entire result set. The process of sending subsequent requests to continue where a previous request left off is called pagination. For example, the ListObjects operation of Amazon S3 returns up to 1000 objects at a time, and you must send subsequent requests with the appropriate Marker in order to retrieve the next page of results.

Operations that have an AWSPager instance can transparently perform subsequent requests, correctly setting Markers and other request facets to iterate through the entire result set of a truncated API operation. Operations which support this have an additional note in the documentation.

Many operations have the ability to filter results on the server side. See the individual operation parameters for details.

GetRecords

GetShardIterator

ListStreams

DescribeStream

Types

KeyType

OperationType

ShardIteratorType

StreamStatus

StreamViewType

AttributeValue

data AttributeValue Source

Represents the data for an attribute. You can set one, and only one, of the elements.

Each attribute in an item is a name-value pair. An attribute can be single-valued or multi-valued set. For example, a book item can have title and authors attributes. Each book has one title but can have many authors. The multi-valued attribute is a set; duplicate values are not allowed.

See: attributeValue smart constructor.

attributeValue :: AttributeValue Source

Creates a value of AttributeValue with the minimum fields required to make a request.

Use one of the following lenses to modify other fields as desired:

avNS :: Lens' AttributeValue [Text] Source

A Number Set data type.

avNULL :: Lens' AttributeValue (Maybe Bool) Source

A Null data type.

avN :: Lens' AttributeValue (Maybe Text) Source

A Number data type.

avBS :: Lens' AttributeValue [ByteString] Source

A Binary Set data type.

avB :: Lens' AttributeValue (Maybe ByteString) Source

A Binary data type.

Note: This Lens automatically encodes and decodes Base64 data, despite what the AWS documentation might say. The underlying isomorphism will encode to Base64 representation during serialisation, and decode from Base64 representation during deserialisation. This Lens accepts and returns only raw unencoded data.

avSS :: Lens' AttributeValue [Text] Source

A String Set data type.

avS :: Lens' AttributeValue (Maybe Text) Source

A String data type.

avBOOL :: Lens' AttributeValue (Maybe Bool) Source

A Boolean data type.

KeySchemaElement

data KeySchemaElement Source

Represents a single element of a key schema. A key schema specifies the attributes that make up the primary key of a table, or the key attributes of an index.

A KeySchemaElement represents exactly one attribute of the primary key. For example, a hash type primary key would be represented by one KeySchemaElement. A hash-and-range type primary key would require one KeySchemaElement for the hash attribute, and another KeySchemaElement for the range attribute.

See: keySchemaElement smart constructor.

keySchemaElement Source

Creates a value of KeySchemaElement with the minimum fields required to make a request.

Use one of the following lenses to modify other fields as desired:

kseAttributeName :: Lens' KeySchemaElement Text Source

The name of a key attribute.

kseKeyType :: Lens' KeySchemaElement KeyType Source

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

Record

data Record Source

A description of a unique event within a stream.

See: record smart constructor.

record :: Record Source

Creates a value of Record with the minimum fields required to make a request.

Use one of the following lenses to modify other fields as desired:

rEventVersion :: Lens' Record (Maybe Text) Source

The version number of the stream record format. Currently, this is 1.0.

rDynamodb :: Lens' Record (Maybe StreamRecord) Source

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

rAwsRegion :: Lens' Record (Maybe Text) Source

The region in which the GetRecords request was received.

rEventName :: Lens' Record (Maybe OperationType) Source

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 the item's attributes were updated.
  • REMOVE - the item was deleted from the table

rEventSource :: Lens' Record (Maybe Text) Source

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

rEventId :: Lens' Record (Maybe Text) Source

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

SequenceNumberRange

data SequenceNumberRange Source

The beginning and ending sequence numbers for the stream records contained within a shard.

See: sequenceNumberRange smart constructor.

sequenceNumberRange :: SequenceNumberRange Source

Creates a value of SequenceNumberRange with the minimum fields required to make a request.

Use one of the following lenses to modify other fields as desired:

Shard

data Shard Source

A uniquely identified group of stream records within a stream.

See: shard smart constructor.

shard :: Shard Source

Creates a value of Shard with the minimum fields required to make a request.

Use one of the following lenses to modify other fields as desired:

sParentShardId :: Lens' Shard (Maybe Text) Source

The shard ID of the current shard's parent.

sSequenceNumberRange :: Lens' Shard (Maybe SequenceNumberRange) Source

The range of possible sequence numbers for the shard.

sShardId :: Lens' Shard (Maybe Text) Source

The system-generated identifier for this shard.

Stream

data Stream Source

Represents all of the data describing a particular stream.

See: stream smart constructor.

stream :: Stream Source

Creates a value of Stream with the minimum fields required to make a request.

Use one of the following lenses to modify other fields as desired:

sStreamLabel :: Lens' Stream (Maybe Text) Source

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

sStreamARN :: Lens' Stream (Maybe Text) Source

The Amazon Resource Name (ARN) for the stream.

sTableName :: Lens' Stream (Maybe Text) Source

The DynamoDB table with which the stream is associated.

StreamDescription

streamDescription :: StreamDescription Source

Creates a value of StreamDescription with the minimum fields required to make a request.

Use one of the following lenses to modify other fields as desired:

sdLastEvaluatedShardId :: Lens' StreamDescription (Maybe Text) Source

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.

sdStreamLabel :: Lens' StreamDescription (Maybe Text) Source

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

sdStreamStatus :: Lens' StreamDescription (Maybe StreamStatus) Source

Indicates the current status of the stream:

  • ENABLING - Streams is currently being enabled on the DynamoDB table.
  • ENABLING - the stream is enabled.
  • DISABLING - Streams is currently being disabled on the DynamoDB table.
  • DISABLED - the stream is disabled.

sdKeySchema :: Lens' StreamDescription (Maybe (NonEmpty KeySchemaElement)) Source

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

sdStreamARN :: Lens' StreamDescription (Maybe Text) Source

The Amazon Resource Name (ARN) for the stream.

sdStreamViewType :: Lens' StreamDescription (Maybe StreamViewType) Source

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 item from the table, as it appeared after they were modified.
  • OLD_IMAGE - entire item from the table, as it appeared before they were modified.
  • NEW_AND_OLD_IMAGES - both the new and the old images of the items from the table.

sdShards :: Lens' StreamDescription [Shard] Source

The shards that comprise the stream.

sdTableName :: Lens' StreamDescription (Maybe Text) Source

The DynamoDB table with which the stream is associated.

sdCreationRequestDateTime :: Lens' StreamDescription (Maybe UTCTime) Source

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

StreamRecord

data StreamRecord Source

A description of a single data modification that was performed on an item in a DynamoDB table.

See: streamRecord smart constructor.

streamRecord :: StreamRecord Source

Creates a value of StreamRecord with the minimum fields required to make a request.

Use one of the following lenses to modify other fields as desired:

srSequenceNumber :: Lens' StreamRecord (Maybe Text) Source

The sequence number of the stream record.

srSizeBytes :: Lens' StreamRecord (Maybe Natural) Source

The size of the stream record, in bytes.

srStreamViewType :: Lens' StreamRecord (Maybe StreamViewType) Source

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 appears 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.

srKeys :: Lens' StreamRecord (HashMap Text AttributeValue) Source

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

srOldImage :: Lens' StreamRecord (HashMap Text AttributeValue) Source

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

srNewImage :: Lens' StreamRecord (HashMap Text AttributeValue) Source

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