Skip to main content

Amazon DynamoDB Component

Create, update, fetch, or delete items in an Amazon (AWS) DynamoDB database

Component key: aws-dynamodb

Description#

Amazon DynamoDB is a key-value and document database from Amazon Web Services. The Amazon DynamoDB component allows you to create, read, update, or delete objects (items) within an Amazon DynamoDB database.

Amazon DynamoDB Connections#

DynamoDB Access Key and Secret#

An AWS IAM access key pair is required to interact with Amazon DynamoDB. Make sure that the key pair you generate in AWS has proper permissions to the DynamoDB resources you want to access. Read more about DynamoDB IAM actions in the AWS docs.

InputNotesExample
Input
Access Key ID
string
/ Required
accessKeyId
Notes
An AWS IAM Access Key ID
Example
AKIAIOSFODNN7EXAMPLE
Input
Secret Access Key
password
/ Required
secretAccessKey
Notes
An AWS IAM Secret Access Key
Example
wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY

Actions#

Create Table#

Create a new DynamoDB Table | key: createTable

InputDefaultNotesExample
Input
Attribute Definition
code
/ Required
attributeDefinition
Default
[  {    "AttributeName": "customerId",    "AttributeType": "N"  },  {    "AttributeName": "customerName",    "AttributeType": "S"  }]
Notes
For each list item, provide a javascript object containing an attribute name, and an attribute type. The attribute type must be in the format that DynamoDB uses: N = number, S = string, L = Array etc...
Example
 
Input
Connection
connection
/ Required
awsConnection
Default
 
Notes
 
Example
 
Input
AWS Region
string
/ Required
awsRegion
Default
us-east-1
Notes
AWS provides services in multiple regions, like us-west-2 or eu-east-1. AWS region indicates the region in which your DynamoDb instance is hosted
Example
us-east-1
Input
Billing Mode
string
/ Required
billingMode
Default
PROVISIONED
Notes
Select the item that represents your desired billing mode.
Example
 
Input
Key Schema
code
/ Required
keySchema
Default
[  {    "KeyType": "HASH",    "AttributeName": "customerId"  },  {    "KeyType": "RANGE",    "AttributeName": "customerName"  }]
Notes
For each list item, provide a javascript object containing an attribute name, and a key type. The key type can either be a HASH or a RANGE key.
Example
 
Input
Read Capacity Units
string
/ Required
readCapacityUnits
Default
5
Notes
One read capacity unit represents one strongly consistent read per second, or two eventually consistent reads per second, for an item up to 4 KB in size.
Example
6000
Input
Table Name
string
/ Required
tableName
Default
Notes
Provide the name of the table you would like to interact with.
Example
Customers
Input
Write Capacity Units
string
/ Required
writeCapacityUnits
Default
5
Notes
One write capacity unit represents one write per second for an item up to 1 KB in size. If you need to write an item that is larger than 1 KB, DynamoDB must consume additional write capacity units.
Example
6000

Output Example Payload#

{  "data": {    "$metadata": {},    "TableDescription": {      "KeySchema": [],      "ItemCount": 0,      "TableName": "example",      "TableArn": "example",      "TableSizeBytes": 0,      "TableStatus": "CREATING"    }  }}

Delete Item#

Delete an item from a DynamoDB database | key: deleteItem

InputDefaultNotesExample
Input
Connection
connection
/ Required
awsConnection
Default
 
Notes
 
Example
 
Input
AWS Region
string
/ Required
awsRegion
Default
us-east-1
Notes
AWS provides services in multiple regions, like us-west-2 or eu-east-1. AWS region indicates the region in which your DynamoDb instance is hosted
Example
us-east-1
Input
Condition Expression
string
conditionExpression
Default
Notes
 
Example
Price > :limit
Input
Expression Attribute Values
string
Key Value List
expressionAttributeValues
Default
Notes
Expression attribute values in Amazon DynamoDB are substitutes for the actual values that you want to compare—values that you might not know until runtime. An expression attribute value must begin with a colon (:) and be followed by one or more alphanumeric characters.
Example
 
Input
Expression Attribute Value Types
string
Key Value List
expressionAttributeValueTypes
Default
Notes
The DynamoDB data type for each query param. You must specify a type for each Expression Attribute Value you provided.
Example
 
Input
Range / Sort Key Value
string
rangeKeyValue
Default
Notes
The value of the optional range key (sort key) to match. This is required if your table has a range key.
Example
Acme Inc
Input
Table Name
string
/ Required
tableName
Default
Notes
Provide the name of the table you would like to interact with.
Example
Customers
Input
Hash / Primary Key Value
string
/ Required
value
Default
Notes
The value of the hash key (primary key) to match
Example
cust_1234

Delete Table#

Delete an existing DynamoDB Table | key: deleteTable

InputDefaultNotesExample
Input
Connection
connection
/ Required
awsConnection
Default
 
Notes
 
Example
 
Input
AWS Region
string
/ Required
awsRegion
Default
us-east-1
Notes
AWS provides services in multiple regions, like us-west-2 or eu-east-1. AWS region indicates the region in which your DynamoDb instance is hosted
Example
us-east-1
Input
Table Name
string
/ Required
tableName
Default
Notes
Provide the name of the table you would like to interact with.
Example
Customers

Output Example Payload#

{  "data": {    "$metadata": {},    "TableDescription": {      "AttributeDefinitions": [],      "KeySchema": [],      "ItemCount": 0,      "TableName": "example",      "TableArn": "example",      "TableSizeBytes": 0,      "TableStatus": "DELETING"    }  }}

Describe Table#

Fetch metadata about an existing DynamoDB Table | key: describeTable

InputDefaultNotesExample
Input
Connection
connection
/ Required
awsConnection
Default
 
Notes
 
Example
 
Input
AWS Region
string
/ Required
awsRegion
Default
us-east-1
Notes
AWS provides services in multiple regions, like us-west-2 or eu-east-1. AWS region indicates the region in which your DynamoDb instance is hosted
Example
us-east-1
Input
Table Name
string
/ Required
tableName
Default
Notes
Provide the name of the table you would like to interact with.
Example
Customers

Output Example Payload#

{  "data": {    "$metadata": {},    "Table": {      "AttributeDefinitions": [],      "KeySchema": [],      "ItemCount": 0,      "TableName": "example",      "TableArn": "example",      "TableSizeBytes": 0,      "TableStatus": "ACTIVE"    }  }}

Get Item#

Retrieve an item from a DynamoDB database | key: getItem

InputDefaultNotesExample
Input
Connection
connection
/ Required
awsConnection
Default
 
Notes
 
Example
 
Input
AWS Region
string
/ Required
awsRegion
Default
us-east-1
Notes
AWS provides services in multiple regions, like us-west-2 or eu-east-1. AWS region indicates the region in which your DynamoDb instance is hosted
Example
us-east-1
Input
Range / Sort Key Value
string
rangeKeyValue
Default
Notes
The value of the optional range key (sort key) to match. This is required if your table has a range key.
Example
Acme Inc
Input
Table Name
string
/ Required
tableName
Default
Notes
Provide the name of the table you would like to interact with.
Example
Customers
Input
Hash / Primary Key Value
string
/ Required
value
Default
Notes
The value of the hash key (primary key) to match
Example
cust_1234

Output Example Payload#

{  "data": {    "result": {      "$metadata": {},      "Item": {}    },    "found": true  }}

List Tables#

List all DynamoDB Tables | key: listTables

InputDefaultNotesExample
Input
Connection
connection
/ Required
awsConnection
Default
 
Notes
 
Example
 
Input
AWS Region
string
/ Required
awsRegion
Default
us-east-1
Notes
AWS provides services in multiple regions, like us-west-2 or eu-east-1. AWS region indicates the region in which your DynamoDb instance is hosted
Example
us-east-1

Output Example Payload#

{  "data": {    "result": {      "$metadata": {},      "TableNames": [        "Table1",        "Table2"      ]    },    "found": true  }}

Update Item#

Update an existing item in a DynamoDB database | key: updateItem

InputDefaultNotesExample
Input
Connection
connection
/ Required
awsConnection
Default
 
Notes
 
Example
 
Input
AWS Region
string
/ Required
awsRegion
Default
us-east-1
Notes
AWS provides services in multiple regions, like us-west-2 or eu-east-1. AWS region indicates the region in which your DynamoDb instance is hosted
Example
us-east-1
Input
Condition Expression
string
conditionExpression
Default
Notes
 
Example
Price > :limit
Input
Update Expression
string
/ Required
query
Default
Notes
An update expression specifies how UpdateItem will modify the attributes of an item. For example, setting a scalar value or removing elements from a list or a map.
Example
set Title = :t, Subtitle = :s'
Input
Expression Attribute Values
string
/ Required
Key Value List
queryParams
Default
Notes
Expression attribute values in Amazon DynamoDB are substitutes for the actual values that you want to compare—values that you might not know until runtime. An expression attribute value must begin with a colon (:) and be followed by one or more alphanumeric characters.
Example
 
Input
Expression Attribute Value Types
string
/ Required
Key Value List
queryParamTypes
Default
Notes
The DynamoDB data type for each query param. You must specify a type for each Expression Attribute Value you provided.
Example
 
Input
Range / Sort Key Value
string
rangeKeyValue
Default
Notes
The value of the optional range key (sort key) to match. This is required if your table has a range key.
Example
Acme Inc
Input
Table Name
string
/ Required
tableName
Default
Notes
Provide the name of the table you would like to interact with.
Example
Customers
Input
Hash / Primary Key Value
string
/ Required
value
Default
Notes
The value of the hash key (primary key) to match
Example
cust_1234

Upsert Item#

Creates a new item, or replaces an existing item with a new item | key: createItem

InputDefaultNotesExample
Input
Connection
connection
/ Required
awsConnection
Default
 
Notes
 
Example
 
Input
AWS Region
string
/ Required
awsRegion
Default
us-east-1
Notes
AWS provides services in multiple regions, like us-west-2 or eu-east-1. AWS region indicates the region in which your DynamoDb instance is hosted
Example
us-east-1
Input
Condition Expression
string
conditionExpression
Default
Notes
 
Example
Price > :limit
Input
Expression Attribute Values
string
Key Value List
expressionAttributeValues
Default
Notes
Expression attribute values in Amazon DynamoDB are substitutes for the actual values that you want to compare—values that you might not know until runtime. An expression attribute value must begin with a colon (:) and be followed by one or more alphanumeric characters.
Example
 
Input
Expression Attribute Value Types
string
Key Value List
expressionAttributeValueTypes
Default
Notes
The DynamoDB data type for each query param. You must specify a type for each Expression Attribute Value you provided.
Example
 
Input
Value
string
/ Required
Key Value List
item
Default
key
Notes
Provide a key value record to be inserted into the specified table.
Example
 
Input
Value Types
string
/ Required
Key Value List
itemTypes
Default
Notes
For each item in the list, provide the datatype corresponding to the input item.
Example
N
Input
Table Name
string
/ Required
tableName
Default
Notes
Provide the name of the table you would like to interact with.
Example
Customers

You must specify a datatype alongside each property you insert. Prismatic will attempt to coerce the inputs you provide to the correct type upon execution. You can specify the datatype of your input with the Value Type input on the create and update item actions. Be sure to pass the correct format into the input, below is a list of types that DynamoDB will expect. S = string, N = number, B = buffer, BOOL = boolean, M = map/object, L = array, SS = string set, NS = number set, BS = buffer set