tables
Creates, updates, deletes, gets or lists a tables resource.
Overview
| Name | tables |
| Type | Resource |
| Id | aws.timestream_write.tables |
Fields
The following fields are returned by SELECT queries:
- describe_table
- list_tables
| Name | Datatype | Description |
|---|---|---|
arn | string | The Amazon Resource Name that uniquely identifies this table. |
creation_time | string (date-time) | The time when the Timestream table was created. |
database_name | string | The name of the Timestream database that contains this table. |
last_updated_time | string (date-time) | The time when the Timestream table was last updated. |
magnetic_store_write_properties | object | Contains properties to set on the table when enabling magnetic store writes. |
retention_properties | object | The retention duration for the memory store and magnetic store. |
schema | object | The schema of the table. |
table_name | string | The name of the Timestream table. |
table_status | string | The current state of the table: DELETING - The table is being deleted. ACTIVE - The table is ready for use. (ACTIVE, DELETING, RESTORING) |
| Name | Datatype | Description |
|---|---|---|
next_token | string | A token to specify where to start paginating. This is the NextToken from a previously truncated response. |
tables | array | A list of tables. |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
describe_table | select | region | Returns information about the table, including the table name, database name, retention duration of the memory store and the magnetic store. Service quotas apply. See code sample for details. | |
list_tables | select | region | Provides a list of tables, along with the name, status, and retention properties of each table. See code sample for details. | |
create_table | insert | region, DatabaseName, TableName | Adds a new table to an existing database in your account. In an Amazon Web Services account, table names must be at least unique within each Region if they are in the same database. You might have identical table names in the same Region if the tables are in separate databases. While creating the table, you must specify the table name, database name, and the retention properties. Service quotas apply. See code sample for details. | |
update_table | update | region, DatabaseName, TableName | Modifies the retention duration of the memory store and magnetic store for your Timestream table. Note that the change in retention duration takes effect immediately. For example, if the retention period of the memory store was initially set to 2 hours and then changed to 24 hours, the memory store will be capable of holding 24 hours of data, but will be populated with 24 hours of data 22 hours after this change was made. Timestream does not retrieve data from the magnetic store to populate the memory store. See code sample for details. | |
delete_table | delete | region | Deletes a given Timestream table. This is an irreversible operation. After a Timestream database table is deleted, the time-series data stored in the table cannot be recovered. Due to the nature of distributed retries, the operation can return either success or a ResourceNotFoundException. Clients should consider them equivalent. See code sample for details. |
Parameters
Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.
| Name | Datatype | Description |
|---|---|---|
region | string | AWS region (default: us-east-1) |
SELECT examples
- describe_table
- list_tables
Returns information about the table, including the table name, database name, retention duration of the memory store and the magnetic store. Service quotas apply. See code sample for details.
SELECT
arn,
creation_time,
database_name,
last_updated_time,
magnetic_store_write_properties,
retention_properties,
schema,
table_name,
table_status
FROM aws.timestream_write.tables
WHERE region = '{{ region }}' -- required
;
Provides a list of tables, along with the name, status, and retention properties of each table. See code sample for details.
SELECT
next_token,
tables
FROM aws.timestream_write.tables
WHERE region = '{{ region }}' -- required
;
INSERT examples
- create_table
- Manifest
Adds a new table to an existing database in your account. In an Amazon Web Services account, table names must be at least unique within each Region if they are in the same database. You might have identical table names in the same Region if the tables are in separate databases. While creating the table, you must specify the table name, database name, and the retention properties. Service quotas apply. See code sample for details.
INSERT INTO aws.timestream_write.tables (
DatabaseName,
TableName,
RetentionProperties,
Tags,
MagneticStoreWriteProperties,
Schema,
region
)
SELECT
'{{ DatabaseName }}' /* required */,
'{{ TableName }}' /* required */,
'{{ RetentionProperties }}',
'{{ Tags }}',
'{{ MagneticStoreWriteProperties }}',
'{{ Schema }}',
'{{ region }}'
RETURNING
table
;
# Description fields are for documentation purposes
- name: tables
props:
- name: region
value: "{{ region }}"
description: Required parameter for the tables resource.
- name: DatabaseName
value: "{{ DatabaseName }}"
description: |
The name of the Timestream database.
- name: TableName
value: "{{ TableName }}"
description: |
The name of the Timestream table.
- name: RetentionProperties
description: |
The duration for which your time-series data must be stored in the memory store and the magnetic store.
value:
MemoryStoreRetentionPeriodInHours: {{ MemoryStoreRetentionPeriodInHours }}
MagneticStoreRetentionPeriodInDays: {{ MagneticStoreRetentionPeriodInDays }}
- name: Tags
description: |
A list of key-value pairs to label the table.
value:
- Key: "{{ Key }}"
Value: "{{ Value }}"
- name: MagneticStoreWriteProperties
description: |
Contains properties to set on the table when enabling magnetic store writes.
value:
EnableMagneticStoreWrites: {{ EnableMagneticStoreWrites }}
MagneticStoreRejectedDataLocation:
S3Configuration:
BucketName: "{{ BucketName }}"
ObjectKeyPrefix: "{{ ObjectKeyPrefix }}"
EncryptionOption: "{{ EncryptionOption }}"
KmsKeyId: "{{ KmsKeyId }}"
- name: Schema
description: |
The schema of the table.
value:
CompositePartitionKey:
- Type: "{{ Type }}"
Name: "{{ Name }}"
EnforcementInRecord: "{{ EnforcementInRecord }}"
UPDATE examples
- update_table
Modifies the retention duration of the memory store and magnetic store for your Timestream table. Note that the change in retention duration takes effect immediately. For example, if the retention period of the memory store was initially set to 2 hours and then changed to 24 hours, the memory store will be capable of holding 24 hours of data, but will be populated with 24 hours of data 22 hours after this change was made. Timestream does not retrieve data from the magnetic store to populate the memory store. See code sample for details.
UPDATE aws.timestream_write.tables
SET
DatabaseName = '{{ DatabaseName }}',
TableName = '{{ TableName }}',
RetentionProperties = '{{ RetentionProperties }}',
MagneticStoreWriteProperties = '{{ MagneticStoreWriteProperties }}',
Schema = '{{ Schema }}'
WHERE
region = '{{ region }}' --required
AND DatabaseName = '{{ DatabaseName }}' --required
AND TableName = '{{ TableName }}' --required
RETURNING
table;
DELETE examples
- delete_table
Deletes a given Timestream table. This is an irreversible operation. After a Timestream database table is deleted, the time-series data stored in the table cannot be recovered. Due to the nature of distributed retries, the operation can return either success or a ResourceNotFoundException. Clients should consider them equivalent. See code sample for details.
DELETE FROM aws.timestream_write.tables
WHERE region = '{{ region }}' --required
;