Skip to main content

tables

Creates, updates, deletes, gets or lists a tables resource.

Overview

Nametables
TypeResource
Idaws.keyspaces.tables

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
capacity_specificationobjectThe read/write throughput capacity mode for a table. The options are: throughputMode:PAY_PER_REQUEST throughputMode:PROVISIONED
cdc_specificationobjectThe CDC stream settings of the table.
client_side_timestampsobjectThe client-side timestamps setting of the table.
commentobjectThe the description of the specified table.
creation_timestampstring (date-time)The creation timestamp of the specified table.
default_time_to_liveintegerThe default Time to Live settings in seconds of the specified table.
encryption_specificationobjectThe encryption settings of the specified table.
keyspace_namestringThe name of the keyspace that the specified table is stored in. (pattern: <code>[a-zA-Z0-9][a-zA-Z0-9_]{0,47}</code>)
latest_stream_arnstringThe Amazon Resource Name (ARN) of the stream. (pattern: <code>arn:(aws[a-zA-Z0-9-]):cassandra:.+.</code>)
point_in_time_recoveryobjectThe point-in-time recovery status of the specified table.
replica_specificationsarrayReturns the Amazon Web Services Region specific settings of all Regions a multi-Region table is replicated in.
resource_arnstringThe Amazon Resource Name (ARN) of the specified table. (pattern: <code>arn:(aws[a-zA-Z0-9-]):cassandra:.+.</code>)
schema_definitionobjectThe schema definition of the specified table.
statusstringThe current status of the specified table. (ACTIVE, CREATING, UPDATING, DELETING, DELETED, RESTORING, INACCESSIBLE_ENCRYPTION_CREDENTIALS)
table_namestringThe name of the specified table. (pattern: <code>[a-zA-Z0-9][a-zA-Z0-9_]{0,47}</code>)
ttlobjectThe custom Time to Live settings of the specified table.
warm_throughput_specificationobjectThe warm throughput settings for the table, including the current status and configured read and write capacity units.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
get_tableselectregionReturns information about the table, including the table's name and current status, the keyspace name, configuration settings, and metadata. To read table metadata using GetTable, the IAM principal needs Select action permissions for the table and the system keyspace.
list_tablesselectregionThe ListTables operation returns a list of tables for a specified keyspace. To read keyspace metadata using ListTables, the IAM principal needs Select action permissions for the system keyspace.
create_tableinsertregion, keyspaceName, tableName, schemaDefinitionThe CreateTable operation adds a new table to the specified keyspace. Within a keyspace, table names must be unique. CreateTable is an asynchronous operation. When the request is received, the status of the table is set to CREATING. You can monitor the creation status of the new table by using the GetTable operation, which returns the current status of the table. You can start using a table when the status is ACTIVE. For more information, see Create a table in the Amazon Keyspaces Developer Guide.
update_tableupdateregion, keyspaceName, tableNameAdds new columns to the table or updates one of the table's settings, for example capacity mode, auto scaling, encryption, point-in-time recovery, or ttl settings. Note that you can only update one specific table setting per update operation.
delete_tabledeleteregionThe DeleteTable operation deletes a table and all of its data. After a DeleteTable request is received, the specified table is in the DELETING state until Amazon Keyspaces completes the deletion. If the table is in the ACTIVE state, you can delete it. If a table is either in the CREATING or UPDATING states, then Amazon Keyspaces returns a ResourceInUseException. If the specified table does not exist, Amazon Keyspaces returns a ResourceNotFoundException. If the table is already in the DELETING state, no error is returned.

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.

NameDatatypeDescription
regionstringAWS region (default: us-east-1)

SELECT examples

Returns information about the table, including the table's name and current status, the keyspace name, configuration settings, and metadata. To read table metadata using GetTable, the IAM principal needs Select action permissions for the table and the system keyspace.

SELECT
capacity_specification,
cdc_specification,
client_side_timestamps,
comment,
creation_timestamp,
default_time_to_live,
encryption_specification,
keyspace_name,
latest_stream_arn,
point_in_time_recovery,
replica_specifications,
resource_arn,
schema_definition,
status,
table_name,
ttl,
warm_throughput_specification
FROM aws.keyspaces.tables
WHERE region = '{{ region }}' -- required
;

INSERT examples

The CreateTable operation adds a new table to the specified keyspace. Within a keyspace, table names must be unique. CreateTable is an asynchronous operation. When the request is received, the status of the table is set to CREATING. You can monitor the creation status of the new table by using the GetTable operation, which returns the current status of the table. You can start using a table when the status is ACTIVE. For more information, see Create a table in the Amazon Keyspaces Developer Guide.

INSERT INTO aws.keyspaces.tables (
keyspaceName,
tableName,
schemaDefinition,
comment,
capacitySpecification,
encryptionSpecification,
pointInTimeRecovery,
ttl,
defaultTimeToLive,
tags,
clientSideTimestamps,
autoScalingSpecification,
replicaSpecifications,
cdcSpecification,
warmThroughputSpecification,
region
)
SELECT
'{{ keyspaceName }}' /* required */,
'{{ tableName }}' /* required */,
'{{ schemaDefinition }}' /* required */,
'{{ comment }}',
'{{ capacitySpecification }}',
'{{ encryptionSpecification }}',
'{{ pointInTimeRecovery }}',
'{{ ttl }}',
{{ defaultTimeToLive }},
'{{ tags }}',
'{{ clientSideTimestamps }}',
'{{ autoScalingSpecification }}',
'{{ replicaSpecifications }}',
'{{ cdcSpecification }}',
'{{ warmThroughputSpecification }}',
'{{ region }}'
RETURNING
resource_arn
;

UPDATE examples

Adds new columns to the table or updates one of the table's settings, for example capacity mode, auto scaling, encryption, point-in-time recovery, or ttl settings. Note that you can only update one specific table setting per update operation.

UPDATE aws.keyspaces.tables
SET
keyspaceName = '{{ keyspaceName }}',
tableName = '{{ tableName }}',
addColumns = '{{ addColumns }}',
capacitySpecification = '{{ capacitySpecification }}',
encryptionSpecification = '{{ encryptionSpecification }}',
pointInTimeRecovery = '{{ pointInTimeRecovery }}',
ttl = '{{ ttl }}',
defaultTimeToLive = {{ defaultTimeToLive }},
clientSideTimestamps = '{{ clientSideTimestamps }}',
autoScalingSpecification = '{{ autoScalingSpecification }}',
replicaSpecifications = '{{ replicaSpecifications }}',
cdcSpecification = '{{ cdcSpecification }}',
warmThroughputSpecification = '{{ warmThroughputSpecification }}'
WHERE
region = '{{ region }}' --required
AND keyspaceName = '{{ keyspaceName }}' --required
AND tableName = '{{ tableName }}' --required
RETURNING
resource_arn;

DELETE examples

The DeleteTable operation deletes a table and all of its data. After a DeleteTable request is received, the specified table is in the DELETING state until Amazon Keyspaces completes the deletion. If the table is in the ACTIVE state, you can delete it. If a table is either in the CREATING or UPDATING states, then Amazon Keyspaces returns a ResourceInUseException. If the specified table does not exist, Amazon Keyspaces returns a ResourceNotFoundException. If the table is already in the DELETING state, no error is returned.

DELETE FROM aws.keyspaces.tables
WHERE region = '{{ region }}' --required
;