Amazon DynamoDB Component
Create, update, fetch, or delete items in an Amazon (AWS) DynamoDB database
Component key: aws-dynamodbDescription
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.
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.
AWS Role ARN
To enable the IAM role authentication begin by logging into the AWS Console and navigate to Identity and Access Management (IAM).
To create an ARN user and generate credentials:
- Navigate to Users and select Create User.
- Provide a User name and check the box providing them user access to the AWS Managment Console if needed.
- Once completed with the User creation, copy the ARN provided in the summary for a later step.
- To obtain the ARN for an existing User, click on the designated username from the Users page and the ARN will be provided in the summary section.
- From the summary section, select Create access key
- Select Third-party service as the access key type and select next.
- Set a description and select create access key.
- Copy the Access Key and Secret access key and enter those into the connection configuration of your integration along with the ARN.
To create and assign a user a role:
- Navigate to Roles and select Create Role.
- Select Custom Trust Policy for the Trusted entity types
- Copy the following statement into the statement console. Making sure to replace the ARN with the user's actual ARN from the previous section
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Principal": {
"AWS": "ARN"
},
"Action": "sts:AssumeRole"
}
]
}
- When adding permissions provide the AmazonDynamoDBFullAccess permission
- Complete remaining steps and select Create Role
Actions
Create Table
Create a new DynamoDB Table | key: createTable
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
Delete Table
Delete an existing DynamoDB Table | key: deleteTable
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
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
Output Example Payload
{
"data": {
"result": {
"$metadata": {},
"Item": {}
},
"found": true
}
}
List Tables
List all DynamoDB Tables | key: listTables
Output Example Payload
{
"data": {
"result": {
"$metadata": {},
"TableNames": [
"Table1",
"Table2"
]
},
"found": true
}
}
Query Items
Query a DynamoDB table | key: queryItems
Raw Request
Execute single PartiQL statements. | key: rawRequest
Update Item
Update an existing item in a DynamoDB database | key: updateItem
Upsert Item
Creates a new item, or replaces an existing item with a new item | key: createItem
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