Amazon DynamoDB Component
Manage tables and items in Amazon DynamoDB.
Component key: aws-dynamodb
Description
Amazon DynamoDB is a key-value and document database from Amazon Web Services (AWS). This component allows you to create, read, update, and delete items within an Amazon DynamoDB database.
API Documentation
This component was built using the AWS DynamoDB API.
Connections
Access Key and Secret
An AWS IAM access key pair is required to interact with Amazon DynamoDB. Ensure the key pair generated in AWS has proper permissions to the DynamoDB resources to access. Read more about DynamoDB IAM actions in the AWS documentation.
Prerequisites
- An AWS account with IAM access
- Appropriate permissions to create IAM access keys
Setup Steps
To create an IAM access key pair:
- Sign in to the AWS Console and navigate to Identity and Access Management (IAM)
- Select the IAM user that will be used for the integration
- Navigate to the Security credentials tab
- Under the Access keys section, select Create access key
- Choose the appropriate use case (e.g., Third-party service or Application running outside AWS)
- Copy both the Access key ID and Secret access key when displayed
The Secret access key is only shown once during creation. If it is not copied at this time, a new access key pair must be created.
Configure the Connection
- Enter the Access key ID into the connection configuration
- Enter the Secret access key into the connection configuration
| Input | Notes | Example |
|---|---|---|
| Access Key ID | An AWS IAM Access Key ID. Learn how to create access keys in the AWS IAM documentation. | AKIAIOSFODNN7EXAMPLE |
| Secret Access Key | An AWS IAM Secret Access Key. Learn how to create access keys in the AWS IAM documentation. | wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY |
AWS Role ARN
AWS IAM role authentication allows connections to DynamoDB using the AWS Security Token Service (STS) AssumeRole operation. This authentication method provides enhanced security by allowing temporary credentials and cross-account access.
Prerequisites
- An AWS account with IAM access
- Permissions to create IAM users, access keys, and roles
- Understanding of AWS IAM roles and trust policies
Setup Steps
Create IAM User and Access Keys
- Sign in to the AWS Console and navigate to Identity and Access Management (IAM)
- Navigate to Users and select Create User
- Provide a User name
- Optionally, grant the user access to the AWS Management Console
- Complete the user creation process
- After creation, the user's ARN will be displayed in the summary section (format:
arn:aws:iam::123456789012:user/username) - Copy the ARN for use in the trust policy in the next section
To obtain the ARN for an existing user:
- Navigate to Users, select the username
- The ARN is displayed in the summary section
Create Access Keys for the User:
- From the user's summary page, select Create access key
- Select Third-party service as the access key type and select Next
- Optionally, set a description tag and select Create access key
- Copy both the Access key ID and Secret access key
The Secret access key is only shown once during creation. If it is not copied at this time, a new access key pair must be created.
Create IAM Role with Trust Policy
- Navigate to Roles and select Create Role
- Select Custom trust policy for the Trusted entity type
- Enter the following trust policy, replacing
arn:aws:iam::123456789012:user/usernamewith the actual user ARN copied in step 6:
Trust Policy JSON
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Principal": {
"AWS": "arn:aws:iam::123456789012:user/username"
},
"Action": "sts:AssumeRole"
}
]
}
- Select Next to configure permissions
- Attach the AmazonDynamoDBFullAccess policy, or create a custom policy with only the required DynamoDB permissions following the principle of least privilege
- Complete the remaining steps and select Create Role
- After creation, navigate to the newly created role and copy the Role ARN from the summary section (format:
arn:aws:iam::123456789012:role/rolename)
Configure the Connection
Enter the following values into the connection configuration:
- Access Key ID: The access key ID from step 10
- Secret Access Key: The secret access key from step 10
- IAM Role ARN: The role ARN from step 17
For more information on IAM role authentication, refer to the AWS STS documentation.
| Input | Notes | Example |
|---|---|---|
| Access Key ID | An AWS IAM Access Key ID | AKIAIOSFODNN7EXAMPLE |
| External ID | Provides enhanced security measures to the connection. Optional, but recommended. Please check AWS docs for more information. | shared-common-secret |
| Role ARN | An AWS IAM Role ARN | arn:aws:iam::OtherAccount-ID:role/assumed-role-name |
| Secret Access Key | An AWS IAM Secret Access Key | wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY |
Data Sources
Select AWS Region
Select an AWS region | key: selectRegion | type: picklist
Select Table
Select a table from the list of tables | key: selectTable | type: picklist
| Input | Notes | Example |
|---|---|---|
| Connection | The AWS DynamoDB connection to use. | |
| AWS Region | AWS provides services in multiple regions, like us-west-2 or eu-west-1. | us-east-1 |
Actions
Create Table
Create a new DynamoDB Table | key: createTable
| Input | Notes | Example |
|---|---|---|
| Attribute Definition | Array of attribute definitions. Each object must contain an AttributeName and AttributeType. See DynamoDB data types. | |
| Connection | The AWS DynamoDB connection to use. | |
| AWS Region | AWS provides services in multiple regions, like us-west-2 or eu-west-1. | us-east-1 |
| Billing Mode | The billing mode for the table. Learn more about billing modes. | PROVISIONED |
| Key Schema | Array of key schema elements. Each object must contain a KeyType (HASH or RANGE) and an AttributeName. Learn more about key schemas. | |
| Read Capacity Units | The number of read capacity units. One unit = one strongly consistent read/sec or two eventually consistent reads/sec for items up to 4 KB. Learn more about read capacity. | 6000 |
| Table Name | The name of the DynamoDB table to interact with. | Customers |
| Write Capacity Units | The number of write capacity units. One unit = one write/sec for items up to 1 KB. Larger items consume additional units. Learn more about write capacity. | 6000 |
{
"data": {
"$metadata": {
"httpStatusCode": 200,
"requestId": "GHI789JKL012MNO345PQR678STU901VW",
"attempts": 1,
"totalRetryDelay": 0
},
"TableDescription": {
"TableName": "Users",
"TableArn": "arn:aws:dynamodb:us-east-1:123456789012:table/Users",
"TableStatus": "CREATING",
"CreationDateTime": "2024-03-20T10:30:00.000Z",
"AttributeDefinitions": [
{
"AttributeName": "userId",
"AttributeType": "S"
},
{
"AttributeName": "email",
"AttributeType": "S"
}
],
"KeySchema": [
{
"AttributeName": "userId",
"KeyType": "HASH"
}
],
"TableSizeBytes": 0,
"ItemCount": 0,
"ProvisionedThroughput": {
"ReadCapacityUnits": 5,
"WriteCapacityUnits": 5,
"NumberOfDecreasesToday": 0
},
"GlobalSecondaryIndexes": [
{
"IndexName": "EmailIndex",
"KeySchema": [
{
"AttributeName": "email",
"KeyType": "HASH"
}
],
"Projection": {
"ProjectionType": "ALL"
},
"IndexStatus": "CREATING",
"ProvisionedThroughput": {
"ReadCapacityUnits": 5,
"WriteCapacityUnits": 5,
"NumberOfDecreasesToday": 0
}
}
]
}
}
}
Delete Item
Delete an item from a DynamoDB database | key: deleteItem
| Input | Notes | Example |
|---|---|---|
| Connection | The AWS DynamoDB connection to use. | |
| AWS Region | AWS provides services in multiple regions, like us-west-2 or eu-west-1. | us-east-1 |
| Condition Expression | A condition that must be satisfied for the operation to succeed. Learn more about condition expressions. | Price > :limit |
| Expression Attribute Values | Expression attribute values are substitutes for actual values in expressions. Each key must begin with a colon (:) followed by alphanumeric characters. Learn more about expression attribute values. | :limit |
| Expression Attribute Value Types | The DynamoDB data type for each expression attribute value. Must specify a type for each value provided in Expression Attribute Values. | |
| Range / Sort Key Value | The value of the optional range key (sort key) to match. <strong>Required</strong> if your table has a range key. | Acme Inc |
| Table Name | The name of the DynamoDB table to interact with. | Customers |
| Hash / Primary Key Value | The value of the hash key (primary key) to match. | cust_1234 |
{
"data": {
"$metadata": {
"httpStatusCode": 200,
"requestId": "MNO345PQR678STU901VWX234YZA567BC",
"attempts": 1,
"totalRetryDelay": 0
},
"ConsumedCapacity": {
"TableName": "Users",
"CapacityUnits": 1
}
}
}
Delete Table
Delete an existing DynamoDB Table | key: deleteTable
| Input | Notes | Example |
|---|---|---|
| Connection | The AWS DynamoDB connection to use. | |
| AWS Region | AWS provides services in multiple regions, like us-west-2 or eu-west-1. | us-east-1 |
| Table Name | The name of the DynamoDB table to interact with. | Customers |
{
"data": {
"$metadata": {
"httpStatusCode": 200,
"requestId": "PQR678STU901VWX234YZA567BCD890EF",
"attempts": 1,
"totalRetryDelay": 0
},
"TableDescription": {
"TableName": "Users",
"TableArn": "arn:aws:dynamodb:us-east-1:123456789012:table/Users",
"TableStatus": "DELETING",
"CreationDateTime": "2024-03-20T10:30:00.000Z",
"AttributeDefinitions": [
{
"AttributeName": "userId",
"AttributeType": "S"
}
],
"KeySchema": [
{
"AttributeName": "userId",
"KeyType": "HASH"
}
],
"TableSizeBytes": 524288,
"ItemCount": 1247,
"ProvisionedThroughput": {
"ReadCapacityUnits": 5,
"WriteCapacityUnits": 5,
"NumberOfDecreasesToday": 0
}
}
}
}
Describe Table
Fetch metadata about an existing DynamoDB Table | key: describeTable
| Input | Notes | Example |
|---|---|---|
| Connection | The AWS DynamoDB connection to use. | |
| AWS Region | AWS provides services in multiple regions, like us-west-2 or eu-west-1. | us-east-1 |
| Table Name | The name of the DynamoDB table to interact with. | Customers |
{
"data": {
"$metadata": {
"httpStatusCode": 200,
"requestId": "JKL012MNO345PQR678STU901VWX234YZ",
"attempts": 1,
"totalRetryDelay": 0
},
"Table": {
"TableName": "Users",
"TableArn": "arn:aws:dynamodb:us-east-1:123456789012:table/Users",
"TableStatus": "ACTIVE",
"CreationDateTime": "2024-03-20T10:30:00.000Z",
"AttributeDefinitions": [
{
"AttributeName": "userId",
"AttributeType": "S"
},
{
"AttributeName": "email",
"AttributeType": "S"
}
],
"KeySchema": [
{
"AttributeName": "userId",
"KeyType": "HASH"
}
],
"TableSizeBytes": 524288,
"ItemCount": 1247,
"ProvisionedThroughput": {
"ReadCapacityUnits": 5,
"WriteCapacityUnits": 5,
"NumberOfDecreasesToday": 0,
"LastIncreaseDateTime": "2024-03-15T08:00:00.000Z",
"LastDecreaseDateTime": "2024-03-10T16:30:00.000Z"
},
"GlobalSecondaryIndexes": [
{
"IndexName": "EmailIndex",
"KeySchema": [
{
"AttributeName": "email",
"KeyType": "HASH"
}
],
"Projection": {
"ProjectionType": "ALL"
},
"IndexStatus": "ACTIVE",
"IndexSizeBytes": 524288,
"ItemCount": 1247,
"ProvisionedThroughput": {
"ReadCapacityUnits": 5,
"WriteCapacityUnits": 5,
"NumberOfDecreasesToday": 0
}
}
]
}
}
}
Get Item
Retrieve an item from a DynamoDB database | key: getItem
| Input | Notes | Example |
|---|---|---|
| Connection | The AWS DynamoDB connection to use. | |
| AWS Region | AWS provides services in multiple regions, like us-west-2 or eu-west-1. | us-east-1 |
| Range / Sort Key Value | The value of the optional range key (sort key) to match. <strong>Required</strong> if your table has a range key. | Acme Inc |
| Table Name | The name of the DynamoDB table to interact with. | Customers |
| Hash / Primary Key Value | The value of the hash key (primary key) to match. | cust_1234 |
{
"data": {
"result": {
"$metadata": {
"httpStatusCode": 200,
"requestId": "Q46HIT95LVKPO8HB708JFS47VV4KQNSO5AEMVJF66Q9ASUAAJG",
"attempts": 1,
"totalRetryDelay": 0
},
"Item": {
"userId": {
"S": "user-12345"
},
"email": {
"S": "john.doe@example.com"
},
"firstName": {
"S": "John"
},
"lastName": {
"S": "Doe"
},
"age": {
"N": "32"
},
"isActive": {
"BOOL": true
},
"createdAt": {
"S": "2024-01-15T10:30:00.000Z"
},
"lastLogin": {
"S": "2024-03-20T14:22:10.000Z"
},
"preferences": {
"M": {
"theme": {
"S": "dark"
},
"notifications": {
"BOOL": true
}
}
},
"tags": {
"L": [
{
"S": "premium"
},
{
"S": "verified"
}
]
}
},
"ConsumedCapacity": {
"TableName": "Users",
"CapacityUnits": 0.5
}
},
"found": true
}
}
List Tables
List all DynamoDB Tables | key: listTables
| Input | Notes | Example |
|---|---|---|
| Connection | The AWS DynamoDB connection to use. | |
| AWS Region | AWS provides services in multiple regions, like us-west-2 or eu-west-1. | us-east-1 |
| Fetch All | When true, automatically fetch all pages of results using pagination. When false, return only the first page. | false |
{
"data": {
"result": {
"$metadata": {
"httpStatusCode": 200,
"requestId": "STU901VWX234YZA567BCD890EFG123HI",
"attempts": 1,
"totalRetryDelay": 0
},
"TableNames": [
"Users",
"Orders",
"Products",
"Inventory",
"Analytics"
]
},
"found": true
}
}
Query Items
Query a DynamoDB table | key: queryItems
| Input | Notes | Example |
|---|---|---|
| Connection | The AWS DynamoDB connection to use. | |
| AWS Region | AWS provides services in multiple regions, like us-west-2 or eu-west-1. | us-east-1 |
| Expression Attribute Values | Expression attribute values are substitutes for actual values in expressions. Each key must begin with a colon (:) followed by alphanumeric characters. Learn more about expression attribute values. | :limit |
| Expression Attribute Value Types | The DynamoDB data type for each expression attribute value. Must specify a type for each value provided in Expression Attribute Values. | |
| Filter Expression | A condition to filter query results after they're retrieved. Cannot filter on partition or sort keys. Learn more about filter expressions. | contains (Subtitle, :topic) |
| Key Condition Expression | The condition specifying key values for the query. Must specify the partition key and optionally a sort key condition. Learn more about key condition expressions. | Season = :s and Episode > :e |
| Query Parameters | Additional parameters to pass to the query operation. These are merged with the command input. | |
| Table Name | The name of the DynamoDB table to interact with. | Customers |
{
"data": {
"$metadata": {
"httpStatusCode": 200,
"requestId": "DEF456GHI789JKL012MNO345PQR678ST",
"attempts": 1,
"totalRetryDelay": 0
},
"Items": [
{
"userId": "user-12345",
"email": "john.doe@example.com",
"firstName": "John",
"lastName": "Doe",
"age": 32,
"isActive": true,
"createdAt": "2024-01-15T10:30:00.000Z",
"preferences": {
"theme": "dark",
"notifications": true
},
"tags": [
"premium",
"verified"
]
},
{
"userId": "user-67890",
"email": "jane.smith@example.com",
"firstName": "Jane",
"lastName": "Smith",
"age": 28,
"isActive": true,
"createdAt": "2024-02-10T09:15:30.000Z",
"preferences": {
"theme": "light",
"notifications": false
},
"tags": [
"verified"
]
}
],
"Count": 2,
"ScannedCount": 2,
"ConsumedCapacity": {
"TableName": "Users",
"CapacityUnits": 0.5
}
}
}
Raw Request
Execute single PartiQL statements. | key: rawRequest
| Input | Notes | Example |
|---|---|---|
| Connection | The AWS DynamoDB connection to use. | |
| AWS Region | AWS provides services in multiple regions, like us-west-2 or eu-west-1. | us-east-1 |
| Parameters | Array of parameter values for the PartiQL statement. Parameters are referenced using ? placeholders in the statement. Learn more about PartiQL parameters. | |
| Query Parameters | Additional parameters to pass to the query operation. These are merged with the command input. | |
| Statement | The PartiQL statement to execute. Use ? for parameters. Learn more about PartiQL for DynamoDB. | INSERT INTO Flowers value {'Name':?} |
{
"data": {
"$metadata": {
"httpStatusCode": 200,
"requestId": "VWX234YZA567BCD890EFG123HIJ456KL",
"attempts": 1,
"totalRetryDelay": 0
},
"Items": [
{
"userId": {
"S": "user-12345"
},
"email": {
"S": "john.doe@example.com"
},
"firstName": {
"S": "John"
},
"lastName": {
"S": "Doe"
}
},
{
"userId": {
"S": "user-67890"
},
"email": {
"S": "jane.smith@example.com"
},
"firstName": {
"S": "Jane"
},
"lastName": {
"S": "Smith"
}
}
]
}
}
Update Item
Update an existing item in a DynamoDB database | key: updateItem
| Input | Notes | Example |
|---|---|---|
| Connection | The AWS DynamoDB connection to use. | |
| AWS Region | AWS provides services in multiple regions, like us-west-2 or eu-west-1. | us-east-1 |
| Condition Expression | A condition that must be satisfied for the operation to succeed. Learn more about condition expressions. | Price > :limit |
| Update Expression | An update expression specifying how to modify item attributes. Learn more about update expressions. | set Title = :t, Subtitle = :s |
| Expression Attribute Values | Expression attribute values are substitutes for actual values in expressions. Each key must begin with a colon (:) followed by alphanumeric characters. Learn more about expression attribute values. | :limit |
| Expression Attribute Value Types | The DynamoDB data type for each expression attribute value. Must specify a type for each value provided in Expression Attribute Values. | |
| Range / Sort Key Value | The value of the optional range key (sort key) to match. <strong>Required</strong> if your table has a range key. | Acme Inc |
| Table Name | The name of the DynamoDB table to interact with. | Customers |
| Hash / Primary Key Value | The value of the hash key (primary key) to match. | cust_1234 |
{
"data": {
"$metadata": {
"httpStatusCode": 200,
"requestId": "XYZ789ABC123DEF456GHI012JKL345MN",
"attempts": 1,
"totalRetryDelay": 0
},
"Attributes": {
"userId": {
"S": "user-12345"
},
"email": {
"S": "john.doe@example.com"
},
"firstName": {
"S": "John"
},
"lastName": {
"S": "Smith"
},
"age": {
"N": "32"
},
"isActive": {
"BOOL": true
},
"updatedAt": {
"S": "2024-03-20T14:22:10.000Z"
}
},
"ConsumedCapacity": {
"TableName": "Users",
"CapacityUnits": 1
}
}
}
Upsert Item
Creates a new item, or replaces an existing item with a new item | key: createItem
| Input | Notes | Example |
|---|---|---|
| Connection | The AWS DynamoDB connection to use. | |
| AWS Region | AWS provides services in multiple regions, like us-west-2 or eu-west-1. | us-east-1 |
| Condition Expression | A condition that must be satisfied for the operation to succeed. Learn more about condition expressions. | Price > :limit |
| Expression Attribute Values | Expression attribute values are substitutes for actual values in expressions. Each key must begin with a colon (:) followed by alphanumeric characters. Learn more about expression attribute values. | :limit |
| Expression Attribute Value Types | The DynamoDB data type for each expression attribute value. Must specify a type for each value provided in Expression Attribute Values. | |
| Value | Key-value pairs representing the item to insert into the table. Each key corresponds to an attribute name. | customerId |
| Value Types | The DynamoDB data type for each item attribute. Must specify a type for each key in the Value field. See DynamoDB data types. | N |
| Table Name | The name of the DynamoDB table to interact with. | Customers |
You must specify a datatype alongside each property you insert.
This action 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
{
"data": {
"$metadata": {
"httpStatusCode": 200,
"requestId": "ABC123DEF456GHI789JKL012MNO345PQ",
"attempts": 1,
"totalRetryDelay": 0
},
"ConsumedCapacity": {
"TableName": "Users",
"CapacityUnits": 1
}
}
}
Changelog
2025-12-16
Improved debug logging throughout the component to aid in troubleshooting integration issues. Debug inputs removed from each action in favor of debug mode.
2025-06-04
Added inline data sources for table selection to enhance data management capabilities