Links

DynamoDB

Amazon DynamoDB is a fully managed, serverless, key-value NoSQL database. UI Bakery allows you to easily connect to DynamoDB with no need for additional layers (APIs or 3rd-party services).

Prerequisites

To connect your DynamoDB to UI Bakery, start with creating a uibakery_dynamodb user in IAM. Enable programmatic access and proceed to the permissions setup. You can grant full DynamoDB permissions, or add the restrictions if required. Make sure to create a new policy and attach it to the new user.

Configuration

  1. 1.
    Open the Data sources - Connect - choose DynamoDB from the list.
  2. 2.
    Specify your AWS Access key ID, Secret access key, and the region of your instance.
3. Click Test connection to check if the connection can be established. Once the connection is successful, click Connect Data source.

Usage

Once connected, you can start writing queries to DynamoDB. Select the DynamoDB request action type, select one of the predefined DynamoDB commands and construct your queries in JS mode.

Query examples

query

query is used to search for or filter the items in your DynamoDB collection. Select query from the list and specify the query parameters:
{
TableName: 'users',
KeyConditionExpression: "Id = :v1",
ExpressionAttributeValues: {
':v1': {"N": '101'},
}
}

scan

scan is used to retrieve all of the items or just some of them from your DynamoDB collection. Select scan from the list and specify the query parameters:
{
TableName: 'users',
}

getItem

The getItem operation returns a set of Attributes for an item that matches the primary key. Select getItem from the list and specify the query parameters:
{
TableName: 'users',
Key: {
Id: {
N: '101'
}
}
}

putItem

To add a new item to your collection, use putItem. Select putItem from the list and specify the query parameters:
{
"TableName": "users",
"Item": {
"Id": {
"N": "110"
},
"username": {
"S": "JohnDoe"
},
"email": {
},
"age": {
"N": "30"
},
"gender": {
"S": "male"
}
}
}

updateItem

updateItem edits an existing item's attributes, or adds a new item to the table if it does not already exist. You can put, delete, or add attribute values. Select updateItem from the list and specify the query parameters:
{
"TableName": "users",
"Key": {
"Id": {
"N": "101"
}
},
"UpdateExpression": "SET Title = :title",
"ExpressionAttributeValues": {
":title": {
"S": {{ui.input.value}}
}
}
}

deleteItem

To delete an item from the collection, use deleteItem. Select deleteItem from the list and specify the query parameters:
{
"TableName": "users",
"Key": {
"Id": {
"N": "101"
}
}
For additional details about the DynamoDB queries, please refer to DynamoDB docs.
Last modified 10mo ago