DynamoDB
This page provides information for connecting your application to your DynamoDB database and for using queries to manage its content.
Connect DynamoDB
If you are a cloud user, you must whitelist the IP addresses 18.223.74.85
and 3.131.104.27
of the Appsmith deployment on your database instance before connecting to your database. Create an IAM Policy with a condition statement to allow these IP addresses. To learn more, see IP address condition operators.
Connection parameters
The following section is a reference guide that provides a complete description of all the parameters to connect to a DynamoDB database.
![Configuring a DynamoDB datasource.](/img/dynamodb-datasource-config.png)
Region
The region where your DynamoDB instance is hosted.
AWS Access Key ID
The AWS access key used to identify your IAM user for DynamoDB. Be sure to use the access key for your IAM user with the set of privileges you want your Appsmith app to have. For more information on using an AWS access key, see Create Access Key.
AWS Secret Access Key
The secret value used to authenticate your queries to DynamoDB. This value is accessible from your AWS security credentials page. To learn more about your AWS Secret Key, see the AWS Security Blog.
Create queries
The following section is a reference guide that provides a complete description of all the read and write operation commands with their parameters to create DynamoDB queries.
![Configuring a DynamoDB scan query.](/img/dynamodb-query-config.png)
For more details about any of the operations below, see the Amazon DynamoDB Actions documentation.
See Setup Server-Side Pagination on Table.
BatchGetItem
This operation fetches many specific records by their partition and sort keys. For example, the following fetches two specific records by their sort and partition keys:
{
"RequestItems": {
"users": {
"Keys": [
{
"team_id": {
"S": "team_1"
},
"employee_id": {
"S": "emp_1"
}
},
{
"team_id": {
"S": "team_3"
},
"employee_id": {
"S": "emp_4"
}
}
]
}
}
}
BatchWriteItem
This operation creates and deletes multiple items in one or more tables. For example, the following creates a new record and deletes an existing one:
{
"RequestItems": {
"users": [
{
"PutRequest": {
"Item": {
"team_id" : {
"S" : "team_1"
},
"employee_id": {
"S" : "emp_1"
},
"name": {
"S" : "Aman"
}
}
}
},
{
"DeleteRequest": {
"Key" : {
"team_id" : {
"S" : "team_1"
},
"employee_id" : {
"S" : "emp_3"
}
}
}
}
]
}
}
CreateBackup
This operation creates a backup with a given name of an entire table. For example, the following creates a backup of the table users
under the name usersBackup
:
{
"BackupName": "usersBackup",
"TableName": "users"
}