tables
Creates, updates, deletes or gets a table
resource or lists tables
in a region
Overview
Name | tables |
Type | Resource |
Description | The AWS::Timestream::Table resource creates a Timestream Table. |
Id | aws.timestream.tables |
Fields
Name | Datatype | Description |
---|---|---|
arn | string | |
name | string | The table name exposed as a read-only attribute. |
database_name | string | The name for the database which the table to be created belongs to. |
table_name | string | The name for the table. If you don't specify a name, AWS CloudFormation generates a unique physical ID and uses that ID for the table name. |
retention_properties | object | The retention duration of the memory store and the magnetic store. |
schema | object | A Schema specifies the expected data model of the table. |
magnetic_store_write_properties | object | The properties that determine whether magnetic store writes are enabled. |
tags | array | An array of key-value pairs to apply to this resource. |
region | string | AWS region. |
Methods
Name | Accessible by | Required Params |
---|---|---|
create_resource | INSERT | DatabaseName, region |
delete_resource | DELETE | data__Identifier, region |
update_resource | UPDATE | data__Identifier, data__PatchDocument, region |
list_resources | SELECT | region |
get_resource | SELECT | data__Identifier, region |
SELECT
examples
Gets all tables
in a region.
SELECT
region,
arn,
name,
database_name,
table_name,
retention_properties,
schema,
magnetic_store_write_properties,
tags
FROM aws.timestream.tables
WHERE region = 'us-east-1';
Gets all properties from an individual table
.
SELECT
region,
arn,
name,
database_name,
table_name,
retention_properties,
schema,
magnetic_store_write_properties,
tags
FROM aws.timestream.tables
WHERE region = 'us-east-1' AND data__Identifier = '<DatabaseName>|<TableName>';
INSERT
example
Use the following StackQL query and manifest file to create a new table
resource, using stack-deploy
.
- Required Properties
- All Properties
- Manifest
/*+ create */
INSERT INTO aws.timestream.tables (
DatabaseName,
region
)
SELECT
'{{ DatabaseName }}',
'{{ region }}';
/*+ create */
INSERT INTO aws.timestream.tables (
DatabaseName,
TableName,
RetentionProperties,
Schema,
MagneticStoreWriteProperties,
Tags,
region
)
SELECT
'{{ DatabaseName }}',
'{{ TableName }}',
'{{ RetentionProperties }}',
'{{ Schema }}',
'{{ MagneticStoreWriteProperties }}',
'{{ Tags }}',
'{{ region }}';
version: 1
name: stack name
description: stack description
providers:
- aws
globals:
- name: region
value: '{{ vars.AWS_REGION }}'
resources:
- name: table
props:
- name: DatabaseName
value: '{{ DatabaseName }}'
- name: TableName
value: '{{ TableName }}'
- name: RetentionProperties
value:
MemoryStoreRetentionPeriodInHours: '{{ MemoryStoreRetentionPeriodInHours }}'
MagneticStoreRetentionPeriodInDays: '{{ MagneticStoreRetentionPeriodInDays }}'
- name: Schema
value:
CompositePartitionKey:
- Type: '{{ Type }}'
Name: '{{ Name }}'
EnforcementInRecord: '{{ EnforcementInRecord }}'
- name: MagneticStoreWriteProperties
value:
EnableMagneticStoreWrites: '{{ EnableMagneticStoreWrites }}'
MagneticStoreRejectedDataLocation:
S3Configuration:
BucketName: '{{ BucketName }}'
ObjectKeyPrefix: '{{ ObjectKeyPrefix }}'
EncryptionOption: '{{ EncryptionOption }}'
KmsKeyId: '{{ KmsKeyId }}'
- name: Tags
value:
- Key: '{{ Key }}'
Value: '{{ Value }}'
DELETE
example
/*+ delete */
DELETE FROM aws.timestream.tables
WHERE data__Identifier = '<DatabaseName|TableName>'
AND region = 'us-east-1';
Permissions
To operate on the tables
resource, the following permissions are required:
Create
timestream:CreateTable,
timestream:DescribeEndpoints,
timestream:TagResource,
s3:PutObject,
s3:GetObject,
s3:GetBucketAcl,
kms:GenerateDataKey*,
kms:DescribeKey,
kms:Encrypt
Read
timestream:DescribeTable,
timestream:DescribeEndpoints,
timestream:ListTagsForResource
Update
timestream:UpdateTable,
timestream:DescribeEndpoints,
timestream:TagResource,
timestream:UntagResource,
s3:PutObject,
s3:GetObject,
s3:GetBucketAcl,
kms:GenerateDataKey*,
kms:DescribeKey,
kms:Encrypt
Delete
timestream:DeleteTable,
timestream:DescribeEndpoints,
timestream:DescribeTable
List
timestream:ListTables,
timestream:DescribeEndpoints