Updated state store docs with DynamoDB TTL (#2203)

* Updated state store docs with DynamoDB TTL

Signed-off-by: Wim <wim.vdc@hotmail.com>

* Making some consistency updates

* Added more realistic example

Signed-off-by: Wim <wim.vdc@hotmail.com>

Co-authored-by: Mark Fussell <markfussell@gmail.com>
Co-authored-by: greenie-msft <56556602+greenie-msft@users.noreply.github.com>
This commit is contained in:
Wim 2022-03-09 07:17:20 +01:00 committed by GitHub
parent 3d926d4c38
commit b328114726
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 15 additions and 4 deletions

View File

@ -47,7 +47,7 @@ The following stores are supported, at various levels, by the Dapr state managem
### Amazon Web Services (AWS)
| Name |CRUD|Transactional|ETag| [TTL]({{< ref state-store-ttl.md >}}) | [Actors]({{< ref howto-actors.md >}}) | [Query]({{< ref howto-state-query-api.md >}}) | Status | Component version | Since |
|----------------------------------------------------|----|-------------|----|----|----|----|------|----|-----|
| [AWS DynamoDB]({{< ref setup-dynamodb.md>}}) | ✅ | ❌ | ❌ | | ❌ | ❌ | Alpha | v1 | 1.0 |
| [AWS DynamoDB]({{< ref setup-dynamodb.md>}}) | ✅ | ❌ | ❌ | | ❌ | ❌ | Alpha | v1 | 1.0 |
### Google Cloud Platform (GCP)
| Name |CRUD|Transactional|ETag| [TTL]({{< ref state-store-ttl.md >}}) | [Actors]({{< ref howto-actors.md >}}) | [Query]({{< ref howto-state-query-api.md >}}) | Status | Component version | Since |

View File

@ -24,15 +24,17 @@ spec:
- name: table
value: "mytable"
- name: accessKey
value: "abcd" # Optional
value: "AKIAIOSFODNN7EXAMPLE" # Optional
- name: secretKey
value: "abcd" # Optional
value: "wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY" # Optional
- name: endpoint
value: "http://localhost:8080" # Optional
- name: region
value: "eu-west-1" # Optional
- name: sessionToken
value: "abcd" # Optional
value: "myTOKEN" # Optional
- name: ttlAttributeName
value: "expiresAt" # Optional
```
{{% alert title="Warning" color="warning" %}}
@ -53,11 +55,20 @@ In order to use DynamoDB as a Dapr state store, the table must have a primary ke
| 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"`
| ttlAttributeName | N |The table attribute name which should be used for TTL. | `"expiresAt"`
## Setup AWS DynamoDB
See [Authenticating to AWS]({{< ref authenticating-aws.md >}}) for information about authentication-related attributes
## Time to live (TTL)
In order to use DynamoDB TTL feature, you must enable TTL on your table and define the attribute name.
The attribute name must be defined in the `ttlAttributeName` field.
See official [AWS docs](https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/TTL.html).
## Related links
- [Basic schema for a Dapr component]({{< ref component-schema >}})
- Read [this guide]({{< ref "howto-get-save-state.md#step-2-save-and-retrieve-a-single-state" >}}) for instructions on configuring state store components
- [State management building block]({{< ref state-management >}})