|
| 1 | +--- |
| 2 | +type: docs |
| 3 | +title: "Alibaba Cloud TableStore" |
| 4 | +linkTitle: "Alibaba Cloud TableStore" |
| 5 | +description: "Detailed information on the Alibaba Cloud TableStore state store component for use with Dapr" |
| 6 | +aliases: |
| 7 | + - "/operations/components/setup-state-store/supported-state-stores/setup-alicloud-tablestore/" |
| 8 | +--- |
| 9 | + |
| 10 | +## Component format |
| 11 | + |
| 12 | +To set up an Alibaba Cloud TableStore state store, create a component of type `state.alicloud.tablestore`. |
| 13 | +See [this guide]({{% ref "howto-get-save-state.md#step-1-setup-a-state-store" %}}) on how to create and apply a state store configuration. |
| 14 | + |
| 15 | +```yaml |
| 16 | +apiVersion: dapr.io/v1alpha1 |
| 17 | +kind: Component |
| 18 | +metadata: |
| 19 | + name: <NAME> |
| 20 | +spec: |
| 21 | + type: state.alicloud.tablestore |
| 22 | + version: v1 |
| 23 | + metadata: |
| 24 | + - name: endpoint |
| 25 | + value: <REPLACE-WITH-ENDPOINT> |
| 26 | + - name: instanceName |
| 27 | + value: <REPLACE-WITH-INSTANCE-NAME> |
| 28 | + - name: tableName |
| 29 | + value: <REPLACE-WITH-TABLE-NAME> |
| 30 | + - name: accessKeyID |
| 31 | + value: <REPLACE-WITH-ACCESS-KEY-ID> |
| 32 | + - name: accessKey |
| 33 | + value: <REPLACE-WITH-ACCESS-KEY> |
| 34 | +```` |
| 35 | + |
| 36 | +{{% alert title="Warning" color="warning" %}} |
| 37 | +The above example uses secrets as plain strings. |
| 38 | +It is recommended to use a secret store for the secrets as described [here]({{% ref component-secrets.md %}}). |
| 39 | +{{% /alert %}} |
| 40 | + |
| 41 | +## Spec metadata fields |
| 42 | + |
| 43 | +| Field | Required | Details | Example | |
| 44 | +| -------------- | :------: | --------------------------------------------------------------------------------- | ----------------------------------- | |
| 45 | +| `endpoint` | Y | The endpoint of the Alibaba Cloud TableStore instance | `"https://tablestore.aliyuncs.com"` | |
| 46 | +| `instanceName` | Y | The name of the Alibaba Cloud TableStore instance | `"my_instance"` | |
| 47 | +| `tableName` | Y | The name of the table to use for Dapr state. Will be created if it does not exist | `"my_table"` | |
| 48 | +| `accessKeyID` | Y | The access key ID for authentication | `"my_access_key_id"` | |
| 49 | +| `accessKey` | Y | The access key for authentication | `"my_access_key"` | |
| 50 | + |
| 51 | +--- |
| 52 | + |
| 53 | +## Authentication |
| 54 | + |
| 55 | +Alibaba Cloud TableStore supports authentication using an **Access Key** and **Access Key ID**. |
| 56 | + |
| 57 | +You can also use Dapr's \[secret store]\({{% ref component-secrets.md %}}) to securely store these values instead of including them directly in the YAML file. |
| 58 | + |
| 59 | +Example using secret references: |
| 60 | + |
| 61 | +```yaml |
| 62 | +- name: accessKeyID |
| 63 | + secretKeyRef: |
| 64 | + name: alicloud-secrets |
| 65 | + key: accessKeyID |
| 66 | +- name: accessKey |
| 67 | + secretKeyRef: |
| 68 | + name: alicloud-secrets |
| 69 | + key: accessKey |
| 70 | +``` |
| 71 | + |
| 72 | +--- |
| 73 | + |
| 74 | + |
| 75 | +## Related links |
| 76 | +- [Basic schema for a Dapr component]({{% ref component-schema %}}) |
| 77 | +- Read [this guide]({{% ref "howto-get-save-state.md#step-2-save-and-retrieve-a-single-state" %}}) for instructions on configuring state store components |
| 78 | +- [State management building block]({{% ref state-management %}}) |
0 commit comments