The documentation you are viewing is for Dapr v1.10 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
配置
To setup a DynamoDB state store create a component of type state.aws.dynamodb
. 请参阅本指南,了解如何创建和应用状态存储配置。
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
以上示例将密钥明文存储, It is recommended to use a secret store for the secrets as described here.元数据字段规范
字段 | 必填 | 详情 | Example |
---|---|---|---|
table | Y | name of the DynamoDB table to use | "mytable" |
accessKey | N | 具有SNS和SQS适当权限的AWS账户的ID。 可以用secretKeyRef 来引用密钥。 |
"AKIAIOSFODNN7EXAMPLE" |
secretKey | N | AWS用户的密钥。 可以用secretKeyRef 来引用密钥。 |
"wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY" |
region | N | AWS区域到实例。 有效区域请参见本页面:https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/Concepts.RegionsAndAvailabilityZones.html。 Ensure that DynamoDB are available in that region. | "us-east-1" |
终结点 | N | 该组件要使用的AWS端点, 仅用于本地开发。 仅用于本地开发。 当对生产环境的AWS,endpoint 是不需要的。 |
"http://localhost:4566" |
sessionToken | N | 要使用的 AWS 会话令牌。 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
相关链接
- Dapr组件的基本格式
- 阅读 本指南 以获取配置状态存储组件的说明
- 状态管理构建块
- 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.