The documentation you are viewing is for Dapr v1.6 which is an older version of Dapr. For up-to-date documentation, see the latest version.
AWS DynamoDB
Detailed information on the AWS DynamoDB state store component
Component format
To setup a DynamoDB state store create a component of type state.aws.dynamodb
. See this guide on how to create and apply a state store configuration.
apiVersion: dapr.io/v1alpha1
kind: Component
metadata:
name: <NAME>
namespace: <NAMESPACE>
spec:
type: state.aws.dynamodb
version: v1
metadata:
- name: table
value: "mytable"
- name: accessKey
value: "abcd" # Optional
- name: secretKey
value: "abcd" # Optional
- name: endpoint
value: "http://localhost:8080" # Optional
- name: region
value: "eu-west-1" # Optional
- name: sessionToken
value: "abcd" # Optional
Warning
The above example uses secrets as plain strings. It is recommended to use a secret store for the secrets as described here.Primary Key
In order to use DynamoDB as a Dapr state store, the table must have a primary key named key
.
Spec metadata fields
Field | Required | Details | Example |
---|---|---|---|
table | Y | name of the DynamoDB table to use | "mytable" |
accessKey | N | ID of the AWS account with appropriate permissions to SNS and SQS. Can be secretKeyRef to use a secret reference |
"AKIAIOSFODNN7EXAMPLE" |
secretKey | N | Secret for the AWS user. Can be secretKeyRef to use a secret reference |
"wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY" |
region | N | The AWS region to the instance. See this page for valid regions: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/Concepts.RegionsAndAvailabilityZones.html. Ensure that DynamoDB are available in that region. | "us-east-1" |
endpoint | N | AWS endpoint for the component to use. Only used for local development. The endpoint is unncessary when running against production AWS |
"http://localhost:4566" |
sessionToken | N | AWS session token to use. A session token is only required if you are using temporary security credentials. | "TOKEN" |
Setup AWS DynamoDB
See Authenticating to AWS for information about authentication-related attributes
Related links
- Basic schema for a Dapr component
- Read this guide for instructions on configuring state store components
- State management building block
- Authenticating to AWS
Feedback
Was this page helpful?
Glad to hear it! Please tell us how we can improve.
Sorry to hear that. Please tell us how we can improve.
Last modified November 30, 2022: Use Google Analytics 4 ID for v1.6 via head-end hook (#2963) (9231f27)