Skip to main content

tables

Creates, updates, deletes or gets a table resource or lists tables in a region

Overview

Nametables
TypeResource
DescriptionThe AWS::Timestream::Table resource creates a Timestream Table.
Idawscc.timestream.tables

Fields

NameDatatypeDescription
arnstring
namestringThe table name exposed as a read-only attribute.
database_namestringThe name for the database which the table to be created belongs to.
table_namestringThe 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_propertiesobjectThe retention duration of the memory store and the magnetic store.
schemaobjectA Schema specifies the expected data model of the table.
magnetic_store_write_propertiesobjectThe properties that determine whether magnetic store writes are enabled.
tagsarrayAn array of key-value pairs to apply to this resource.
regionstringAWS region.

For more information, see AWS::Timestream::Table.

Methods

NameResourceAccessible byRequired Params
create_resourcetablesINSERTDatabaseName, region
delete_resourcetablesDELETEIdentifier, region
update_resourcetablesUPDATEIdentifier, PatchDocument, region
list_resourcestables_list_onlySELECTregion
get_resourcetablesSELECTIdentifier, region

SELECT examples

Gets all properties from an individual table.

SELECT
region,
arn,
name,
database_name,
table_name,
retention_properties,
schema,
magnetic_store_write_properties,
tags
FROM awscc.timestream.tables
WHERE
region = '{{ region }}' AND
Identifier = '{{ database_name }}|{{ table_name }}';

INSERT example

Use the following StackQL query and manifest file to create a new table resource, using stack-deploy.

/*+ create */
INSERT INTO awscc.timestream.tables (
DatabaseName,
region
)
SELECT
'{{ database_name }}',
'{{ region }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;

UPDATE example

Use the following StackQL query and manifest file to update a table resource, using stack-deploy.

/*+ update */
UPDATE awscc.timestream.tables
SET PatchDocument = string('{{ {
"RetentionProperties": retention_properties,
"Schema": schema,
"MagneticStoreWriteProperties": magnetic_store_write_properties,
"Tags": tags
} | generate_patch_document }}')
WHERE
region = '{{ region }}' AND
Identifier = '{{ database_name }}|{{ table_name }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;

DELETE example

/*+ delete */
DELETE FROM awscc.timestream.tables
WHERE
Identifier = '{{ database_name }}|{{ table_name }}' AND
region = '{{ region }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;

Additional Parameters

Mutable resources in the Cloud Control provider support additional optional parameters which can be supplied with INSERT, UPDATE, or DELETE operations. These include:

ParameterDescription
ClientToken
A unique identifier to ensure the idempotency of the resource request.This allows the provider to accurately distinguish between retries and new requests.
A client token is valid for 36 hours once used.
After that, a resource request with the same client token is treated as a new request.
If you do not specify a client token, one is generated for inclusion in the request.
RoleArn
The ARN of the IAM role used to perform this resource operation.The role specified must have the permissions required for this operation.
If you do not specify a role, a temporary session is created using your AWS user credentials.
TypeVersionId
For private resource types, the type version to use in this resource operation.If you do not specify a resource version, the default version is used.

Permissions

To operate on the tables resource, the following permissions are required:

timestream:CreateTable,
timestream:DescribeEndpoints,
timestream:TagResource,
s3:PutObject,
s3:GetObject,
s3:GetBucketAcl,
kms:GenerateDataKey,
kms:GenerateDataKeyWithoutPlaintext,
kms:DescribeKey,
kms:Encrypt