Skip to main content

tables

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

Overview

Nametables
TypeResource
DescriptionResource schema for AWS::Cassandra::Table
Idawscc.cassandra.tables

Fields

NameDatatypeDescription
keyspace_namestringName for Cassandra keyspace
table_namestringName for Cassandra table
regular_columnsarrayNon-key columns of the table
partition_key_columnsarrayPartition key columns of the table
clustering_key_columnsarrayClustering key columns of the table
billing_modeobject
point_in_time_recovery_enabledbooleanIndicates whether point in time recovery is enabled (true) or disabled (false) on the table
client_side_timestamps_enabledbooleanIndicates whether client side timestamps are enabled (true) or disabled (false) on the table. False by default, once it is enabled it cannot be disabled again.
tagsarrayAn array of key-value pairs to apply to this resource
default_time_to_liveintegerDefault TTL (Time To Live) in seconds, where zero is disabled. If the value is greater than zero, TTL is enabled for the entire table and an expiration timestamp is added to each column.
encryption_specificationobjectRepresents the settings used to enable server-side encryption
auto_scaling_specificationsobjectRepresents the read and write settings used for AutoScaling.
cdc_specificationobjectRepresents the CDC configuration for the table
replica_specificationsarray
regionstringAWS region.

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

Methods

NameResourceAccessible byRequired Params
create_resourcetablesINSERTKeyspaceName, PartitionKeyColumns, 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,
keyspace_name,
table_name,
regular_columns,
partition_key_columns,
clustering_key_columns,
billing_mode,
point_in_time_recovery_enabled,
client_side_timestamps_enabled,
tags,
default_time_to_live,
encryption_specification,
auto_scaling_specifications,
cdc_specification,
replica_specifications
FROM awscc.cassandra.tables
WHERE
region = '{{ region }}' AND
Identifier = '{{ keyspace_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.cassandra.tables (
KeyspaceName,
PartitionKeyColumns,
region
)
SELECT
'{{ keyspace_name }}',
'{{ partition_key_columns }}',
'{{ 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.cassandra.tables
SET PatchDocument = string('{{ {
"RegularColumns": regular_columns,
"BillingMode": billing_mode,
"PointInTimeRecoveryEnabled": point_in_time_recovery_enabled,
"Tags": tags,
"DefaultTimeToLive": default_time_to_live,
"EncryptionSpecification": encryption_specification,
"AutoScalingSpecifications": auto_scaling_specifications,
"CdcSpecification": cdc_specification,
"ReplicaSpecifications": replica_specifications
} | generate_patch_document }}')
WHERE
region = '{{ region }}' AND
Identifier = '{{ keyspace_name }}|{{ table_name }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;

DELETE example

/*+ delete */
DELETE FROM awscc.cassandra.tables
WHERE
Identifier = '{{ keyspace_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:

cassandra:Create,
cassandra:CreateMultiRegionResource,
cassandra:Select,
cassandra:SelectMultiRegionResource,
cassandra:TagResource,
cassandra:TagMultiRegionResource,
kms:CreateGrant,
kms:DescribeKey,
kms:Encrypt,
kms:Decrypt,
application-autoscaling:DescribeScalableTargets,
application-autoscaling:DescribeScalingPolicies,
application-autoscaling:DeregisterScalableTarget,
application-autoscaling:RegisterScalableTarget,
application-autoscaling:PutScalingPolicy,
cloudwatch:DeleteAlarms,
cloudwatch:DescribeAlarms,
cloudwatch:GetMetricData,
cloudwatch:PutMetricAlarm,
iam:CreateServiceLinkedRole