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.

Authorization Notes#

An AWS IAM access key pair is required to interact with Amazon DynamoDB. The AWS access_key_id serves as the API Key, and the secret_access_key serves as the API Secret. 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.

Actions#

Create Table#

Create a new DynamoDB Table | key: createTable

InputKeyDefaultNotesExample

Attribute Definition

code
/ Required
attributeDefinition
[{ AttributeName: "customerId", AttributeType: "N" }]
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...{ AttributeName: "customerId", AttributeType: "N" }

AWS Region

string
/ Required
awsRegionus-east-1AWS provides services in multiple regions, like us-west-2 or eu-east-1. AWS region indicates the region in which your DynamoDb instance is hostedus-east-1

Billing Mode

string
/ Required
billingModePROVISIONEDSelect the item that represents your desired billing mode.

Key Schema

code
/ Required
keySchema
[{ KeyType: "HASH", AttributeName: "CustomerId" }]
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.{ KeyType: "HASH", AttributeName: "CustomerId" }

ReadCapacityUnits

string
readCapacityUnitsOne 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.6000

Table Name

string
/ Required
tableNameProvide the name of the table you would like to interact with.Customers

Billing Mode

string
writeCapacityUnitsOne 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.6000

Authorization#

Authorization is required for this action.
Auth TypeKeyDescriptionFields
API Key / Secretapi_key_secretAPI Key / Secret Combination

API Key |  api_key

API Secret |  api_secret

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

InputKeyDefaultNotesExample

AWS Region

string
/ Required
awsRegionus-east-1AWS provides services in multiple regions, like us-west-2 or eu-east-1. AWS region indicates the region in which your DynamoDb instance is hostedus-east-1

Hash Key

string
/ Required
hashKeyA single row in DynamoDB has a unique primary key made up of both the hash and the range key.customerId

Table Name

string
/ Required
tableNameProvide the name of the table you would like to interact with.Customers

Item value

string
/ Required
valueEnter the value of the hash key for the record you would like to access.cust_126

Authorization#

Authorization is required for this action.
Auth TypeKeyDescriptionFields
API Key / Secretapi_key_secretAPI Key / Secret Combination

API Key |  api_key

API Secret |  api_secret

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

InputKeyDefaultNotesExample

AWS Region

string
/ Required
awsRegionus-east-1AWS provides services in multiple regions, like us-west-2 or eu-east-1. AWS region indicates the region in which your DynamoDb instance is hostedus-east-1

Table Name

string
/ Required
tableNameProvide the name of the table you would like to interact with.Customers

Authorization#

Authorization is required for this action.
Auth TypeKeyDescriptionFields
API Key / Secretapi_key_secretAPI Key / Secret Combination

API Key |  api_key

API Secret |  api_secret

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

InputKeyDefaultNotesExample

AWS Region

string
/ Required
awsRegionus-east-1AWS provides services in multiple regions, like us-west-2 or eu-east-1. AWS region indicates the region in which your DynamoDb instance is hostedus-east-1

Value Type

string
/ Required
dataTypeProvide 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.N

Hash Key

string
/ Required
hashKeyA single row in DynamoDB has a unique primary key made up of both the hash and the range key.customerId

Table Name

string
/ Required
tableNameProvide the name of the table you would like to interact with.Customers

Item value

string
/ Required
valueEnter the value of the hash key for the record you would like to access.cust_126

Authorization#

Authorization is required for this action.
Auth TypeKeyDescriptionFields
API Key / Secretapi_key_secretAPI Key / Secret Combination

API Key |  api_key

API Secret |  api_secret

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  }}

Update Item#

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

InputKeyDefaultNotesExample

AWS Region

string
/ Required
awsRegionus-east-1AWS provides services in multiple regions, like us-west-2 or eu-east-1. AWS region indicates the region in which your DynamoDb instance is hostedus-east-1

Value

string
/ Required
itemkeyProvide a key value record to be inserted into the specified table.

Value Types

string
/ Required
itemTypesFor 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.N

Query

string
/ Required
queryItem keyAn 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.set #a = :x + :y

Value

string
/ Required
queryParamskeyExpression 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.[{key: ":id", value: "example customer id"}]

Table Name

string
/ Required
tableNameProvide the name of the table you would like to interact with.Customers

Authorization#

Authorization is required for this action.
Auth TypeKeyDescriptionFields
API Key / Secretapi_key_secretAPI Key / Secret Combination

API Key |  api_key

API Secret |  api_secret

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

InputKeyDefaultNotesExample

AWS Region

string
/ Required
awsRegionus-east-1AWS provides services in multiple regions, like us-west-2 or eu-east-1. AWS region indicates the region in which your DynamoDb instance is hostedus-east-1

Value

string
/ Required
itemkeyProvide a key value record to be inserted into the specified table.

Value Types

string
/ Required
itemTypesFor 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.N

Table Name

string
/ Required
tableNameProvide the name of the table you would like to interact with.Customers

Authorization#

Authorization is required for this action.
Auth TypeKeyDescriptionFields
API Key / Secretapi_key_secretAPI Key / Secret Combination

API Key |  api_key

API Secret |  api_secret

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": {}    }  }}