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
Notes
An AWS IAM Access Key ID
Example
AKIAIOSFODNN7EXAMPLE
Input
Secret Access Key
password
/ Required
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
Default
[  {    "AttributeName": "customerId",    "AttributeType": "N"  }]
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
[{ "AttributeName": "customerId", "AttributeType": "N" }]
Input
Connection
connection
/ Required
Default
 
Notes
 
Example
 
Input
AWS Region
string
/ Required
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
Default
PROVISIONED
Notes
Select the item that represents your desired billing mode.
Example
 
Input
Key Schema
code
/ Required
Default
[  {    "KeyType": "HASH",    "AttributeName": "customerId"  }]
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
[{ "KeyType": "HASH", "AttributeName": "customerId" }]
Input
Read Capacity Units
string
/ Required
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
Default
 
Notes
Provide the name of the table you would like to interact with.
Example
Customers
Input
Write Capacity Units
string
/ Required
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": {    "TableDescription": {      "KeySchema": [],      "GlobalTableVersion": "",      "ItemCount": 4,      "BillingModeSummary": {},      "TableName": "example",      "TableArn": "example"    }  }}

Delete Item#

Delete an item from a DynamoDB database | key: deleteItem

InputDefaultNotesExample
Input
Connection
connection
/ Required
Default
 
Notes
 
Example
 
Input
AWS Region
string
/ Required
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
Hash Key
string
/ Required
Default
 
Notes
A single row in DynamoDB has a unique primary key made up of both the hash and the range key.
Example
customerId
Input
Table Name
string
/ Required
Default
 
Notes
Provide the name of the table you would like to interact with.
Example
Customers
Input
Item value
string
/ Required
Default
 
Notes
Enter the value of the hash key for the record you would like to access.
Example
cust_126

Output Example Payload#

{  "data": {    "Attributes": {},    "ConsumedCapacity": {      "CapacityUnits": 1,      "GlobalSecondaryIndexes": {},      "LocalSecondaryIndexes": {},      "ReadCapacityUnits": 92,      "Table": {        "CapacityUnits": 104,        "ReadCapacityUnits": 92,        "WriteCapacityUnits": 12      },      "TableName": "Example Table",      "WriteCapacityUnits": 12    },    "ItemCollectionMetrics": {}  }}

Delete Table#

Delete an existing DynamoDB Table | key: deleteTable

InputDefaultNotesExample
Input
Connection
connection
/ Required
Default
 
Notes
 
Example
 
Input
AWS Region
string
/ Required
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
Default
 
Notes
Provide the name of the table you would like to interact with.
Example
Customers

Output Example Payload#

{  "data": {    "TableDescription": {      "KeySchema": [],      "GlobalTableVersion": "",      "ItemCount": 4,      "BillingModeSummary": {},      "TableName": "example",      "TableArn": "example"    }  }}

Get Item#

Retrieve an item from a DynamoDB database | key: getItem

InputDefaultNotesExample
Input
Connection
connection
/ Required
Default
 
Notes
 
Example
 
Input
AWS Region
string
/ Required
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
Value Type
string
/ Required
Default
 
Notes
Provide the datatype corresponding to the hash key. When providing the datatype be sure to use the DynamoDB naming conventions: N = number, S = string, B = buffer, L = list/array, M = map/object, SS = string set, NS = number set, BS = buffer set., BOOL = Boolean
Example
N
Input
Hash Key
string
/ Required
Default
 
Notes
A single row in DynamoDB has a unique primary key made up of both the hash and the range key.
Example
customerId
Input
Table Name
string
/ Required
Default
 
Notes
Provide the name of the table you would like to interact with.
Example
Customers
Input
Item value
string
/ Required
Default
 
Notes
Enter the value of the hash key for the record you would like to access.
Example
cust_126

Output Example Payload#

{  "data": {    "result": {      "ConsumedCapacity": {        "CapacityUnits": 1,        "GlobalSecondaryIndexes": {},        "LocalSecondaryIndexes": {},        "ReadCapacityUnits": 92,        "Table": {          "CapacityUnits": 104,          "ReadCapacityUnits": 92,          "WriteCapacityUnits": 12        },        "TableName": "Example Table",        "WriteCapacityUnits": 12      },      "Item": {}    },    "found": true  }}

List Tables#

List all DynamoDB Tables | key: listTables

InputDefaultNotesExample
Input
Connection
connection
/ Required
Default
 
Notes
 
Example
 
Input
AWS Region
string
/ Required
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": {      "TableNames": [        "Customers",        "Orders",        "Products"      ]    },    "found": true  }}

Update Item#

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

InputDefaultNotesExample
Input
Connection
connection
/ Required
Default
 
Notes
 
Example
 
Input
AWS Region
string
/ Required
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
Value
string
/ Required
Key Value List
Default
key
Notes
Provide a key value record to be inserted into the specified table.
Example
 
Input
Value Types
string
/ Required
Key Value List
Default
 
Notes
For each item in the list, provide the datatype corresponding to the input item. When providing the datatype be sure to use the DynamoDB naming conventions: N = number, S = string, B = buffer, L = list/array, M = map/object, SS = string set, NS = number set, BS = buffer set., BOOL = Boolean
Example
N
Input
Query
string
/ Required
Default
Item key
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 #a = :x + :y
Input
Value
string
/ Required
Key Value List
Default
key
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
[{key: ":id", value: "example customer id"}]
Input
Table Name
string
/ Required
Default
 
Notes
Provide the name of the table you would like to interact with.
Example
Customers

Output Example Payload#

{  "data": {    "ConsumedCapacity": {      "CapacityUnits": 1,      "GlobalSecondaryIndexes": {},      "LocalSecondaryIndexes": {},      "ReadCapacityUnits": 92,      "Table": {        "CapacityUnits": 104,        "ReadCapacityUnits": 92,        "WriteCapacityUnits": 12      },      "TableName": "Example Table",      "WriteCapacityUnits": 12    },    "Attributes": {},    "ItemCollectionMetrics": {      "ItemCollectionKey": {}    }  }}

Upsert Item#

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

InputDefaultNotesExample
Input
Connection
connection
/ Required
Default
 
Notes
 
Example
 
Input
AWS Region
string
/ Required
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
Value
string
/ Required
Key Value List
Default
key
Notes
Provide a key value record to be inserted into the specified table.
Example
 
Input
Value Types
string
/ Required
Key Value List
Default
 
Notes
For each item in the list, provide the datatype corresponding to the input item. When providing the datatype be sure to use the DynamoDB naming conventions: N = number, S = string, B = buffer, L = list/array, M = map/object, SS = string set, NS = number set, BS = buffer set., BOOL = Boolean
Example
N
Input
Table Name
string
/ Required
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

Output Example Payload#

{  "data": {    "Attributes": {},    "ConsumedCapacity": {      "CapacityUnits": 1,      "GlobalSecondaryIndexes": {},      "LocalSecondaryIndexes": {},      "ReadCapacityUnits": 92,      "Table": {        "CapacityUnits": 104,        "ReadCapacityUnits": 92,        "WriteCapacityUnits": 12      },      "TableName": "Example Table",      "WriteCapacityUnits": 12    },    "ItemCollectionMetrics": {      "ItemCollectionKey": {}    }  }}