Skip to main content

Connect to Amazon DynamoDB

Amazon DynamoDB is a fully managed NoSQL database service that stores data as items in tables.

What you can do with Amazon DynamoDB in Retool

After you create an Amazon DynamoDB resource in Retool, you can:

  • Query and scan tables with filters and projections.
  • Get, insert, update, and delete individual items.
  • Paginate through large result sets automatically.
  • Use a visual parameter editor or write parameters as raw JSON.

Before you begin

To connect Amazon DynamoDB to Retool, you need the following:

  • AWS account: Access to one or more DynamoDB tables.
  • AWS credentials: An AWS access key ID and secret access key with permissions to query the target tables, or an IAM role to assume.
  • Retool permissions: Ability to create and manage resources in your organization.

Create an Amazon DynamoDB resource

Follow these steps to create an Amazon DynamoDB resource in your Retool organization.

Create a new resource

In your Retool organization, navigate to Resources in the main navigation and click Create newResource. Search for "DynamoDB" and click the Amazon DynamoDB tile to begin configuration.

Best practice

Use folders to organize your resources by team, environment, or resource type. This helps keep your resource list manageable as your organization grows.

Configure general settings

Specify a name and description for the resource that indicates which AWS account or tables it connects to. The description provides more context to users and Assist about how to use the resource.

Example nameExample description
Orders tableDynamoDB tables containing order and shipment records.
Analytics tables (read only)Read-only DynamoDB tables used for reporting dashboards.

Configure resource credentials

Configure the connection settings for your Amazon DynamoDB resource.

Amazon DynamoDB resource configuration form.

AWS region

The AWS region of the DynamoDB tables you want to connect to.

Example
us-east-1

Authentication

Choose an authentication method based on your deployment type and security requirements.

Authentication methodUse cases
AWS access key and secretDirect authentication with an IAM user's credentials. Available on both Cloud and self-hosted.
Default credential provider chainSources credentials from environment variables or the underlying instance role. Self-hosted only.

AWS access key ID

The access key ID for an IAM user with permissions to query the target tables. Refer to AWS docs to find access keys.

AWS secret key ID

The secret access key that corresponds to the AWS access key ID.

Role to assume (ARN)

Optionally, provide the ARN of a different role to assume when accessing DynamoDB, rather than using the permissions attached to the credentials above directly.

Example
arn:aws:iam::123456789012:role/DynamoDBReadOnlyRole

Configure advanced options

Configure optional settings available under the Advanced options section of the resource configuration form.

Outbound region

If your organization uses outbound regions, select the region that should be used for requests to DynamoDB. This controls which geographic region your requests originate from.

Test the connection

Click Test connection to verify Retool can connect to DynamoDB. If the test fails, check the following:

  • Credentials: Verify the AWS access key ID and secret key are correct and haven't been deactivated.
  • AWS Region: Confirm the region matches where your DynamoDB tables are located.
  • Permissions: Ensure the IAM user or assumed role has permissions to list and query the target tables.
Use Debug Tools for detailed connection information

After testing the connection, click View in console to open the Debug Tools console. The console displays the test request executed, its response, execution time, and error details if the test fails. This information is helpful for troubleshooting connection issues.

Save the resource

Click Create resource to save your Amazon DynamoDB resource. You can now use it in queries across your Retool apps and automations.

Interact with Amazon DynamoDB data

Once you've created an Amazon DynamoDB resource, you can interact with DynamoDB data using Retool.

Switch to the new app builder

Retool recommends using the new app builder so you can use natural language to build React-based apps using AI.

  • To use Amazon DynamoDB data in the app builder, reference the resource in the prompt with @, such as @Orders table. Refer to the data and functions documentation to learn more.
  • For classic apps, workflows, and agents, refer to the resource query documentation to learn how to write a query.

Best practices

Follow these best practices to maintain the security of your Amazon DynamoDB resource.

  • Apply least privilege: Scope the IAM user's or assumed role's policy to only the specific tables and actions (Query, Scan, GetItem, PutItem, UpdateItem, DeleteItem) your apps need.
  • Use a role to assume rather than long-lived keys: Where possible, configure Role to assume (ARN) with a role that has a limited session duration, rather than relying solely on long-lived access keys.
  • Use resource environments: Configure multiple resource environments to maintain separate AWS credentials or table names for production, staging, and development.