The ALIYUN::OTS::Table resource creates a table based on the specified table schema.
Syntax
{
"Type": "ALIYUN::OTS::Table",
"Properties": {
"ReservedThroughput": Map,
"MaxVersions": Integer,
"TableName": String,
"SecondaryIndices": List,
"DeviationCellVersionInSec": Integer,
"TimeToLive": Integer,
"InstanceName": String,
"PrimaryKey": List,
"Columns": List
}
}Properties
| Property | Type | Required | Update allowed | Description | Constraints |
| ReservedThroughput | Map | No | Yes | The initial reserved read and write throughput of the table. | The reserved read throughput and reserved write throughput for any table cannot exceed 5,000 reads/writes per second. For more information, see the ReservedThroughput property. |
| MaxVersions | Integer | No | Yes | The maximum number of versions to retain for the table. | Valid values: 1 to 2,147,483,647. Default value: 1. |
| TableName | String | Yes | No | The name of the table. | None |
| SecondaryIndices | List | No | No | The secondary indexes of the table. | For more information, see the SecondaryIndices property. |
| DeviationCellVersionInSec | Integer | No | Yes | The maximum version drift. | This property prevents writing data with a timestamp that deviates significantly from the expected time. For example, if the current UNIX timestamp is 10,000 and you set DeviationCellVersionInSec to 1,000, the allowed timestamp range for writes is 9,000 to 11,000. Valid values: 1 to 9,223,372,036,854,775,807. Default value: 86,400. |
| TimeToLive | Integer | No | Yes | The retention period of data in the table. | Maximum value: 2,147,483,647. Default value: 1. Unit: seconds. A value of -1 indicates that the data never expires. |
| InstanceName | String | Yes | No | The name of the Tablestore instance where the table resides. | None |
| PrimaryKey | List | Yes | No | All primary key columns of the table. | Valid values: 1 to 4. For more information, see the PrimaryKey property. |
| Columns | List | No | No | The attribute columns stored in the table. | For more information, see the Columns property. |
ReservedThroughput syntax
"ReservedThroughput": {
"Read": Integer,
"Write": Integer
}ReservedThroughput properties
| Property Name | Type | Required | Update allowed | Description | Constraints |
| Read | Integer | Yes | Yes | The capacity units for reads or the reserved read throughput of the table. | Default value: 0. |
| Write | Integer | Yes | Yes | The capacity units for writes or the reserved write throughput of the table. | Default value: 0. |
SecondaryIndices syntax
"SecondaryIndices": [
{
"IndexName": String,
"IndexType": String,
"Columns": List,
"PrimaryKeys": List
}
]SecondaryIndices properties
| Property Name | Type | Required | Update allowed | Description | Constraints |
| IndexName | String | Yes | No | The index name. | None |
| IndexType | String | No | No | The index type. | Valid values:
|
| Columns | List | Yes | No | The index columns. | Example: Note This property is different from the Columns property. |
| PrimaryKeys | List | Yes | No | The primary keys. | None |
PrimaryKey syntax
"PrimaryKey": [
{
"Type": String,
"Name": String
}
]PrimaryKey properties
| Property | Type | Required | Update allowed | Description | Constraints |
| Type | String | Yes | No | The type of the primary key. | Valid values:
|
| Name | String | Yes | No | The name of the primary key. | None |
Columns syntax
"Columns": [
{
"Type": String,
"Name": String
}
]Columns properties
| Property | Type | Required | Update allowed | Description | Constraints |
| Type | String | Yes | No | The type of the column. | None |
| Name | String | Yes | No | The name of the column. | None |
Return value
Fn::GetAtt
TableName: The name of the table.
Examples
JSONformat{ "ROSTemplateFormatVersion": "2015-09-01", "Parameters": { }, "Resources": { "Table": { "Type": "ALIYUN::OTS::Table", "Properties": { "TableName": "TestTable", "InstanceName": "mytest", "PrimaryKey": [ { "Type": "INTEGER", "Name": "id" } ] } } } }
该文章对您有帮助吗?