Skip to main content

keyspaces

Creates, updates, deletes or gets a keyspace resource or lists keyspaces in a region

Overview

Namekeyspaces
TypeResource
DescriptionResource schema for AWS::Cassandra::Keyspace
Idawscc.cassandra.keyspaces

Fields

NameDatatypeDescription
keyspace_namestringName for Cassandra keyspace
tagsarray
replication_specificationobject
client_side_timestamps_enabledbooleanIndicates whether client-side timestamps are enabled (true) or disabled (false) for all tables in the keyspace. To add a Region to a single-Region keyspace with at least one table, the value must be set to true. After you enabled client-side timestamps for a table, you can’t disable it again.
regionstringAWS region.

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

Methods

NameResourceAccessible byRequired Params
create_resourcekeyspacesINSERT, region
delete_resourcekeyspacesDELETEIdentifier, region
update_resourcekeyspacesUPDATEIdentifier, PatchDocument, region
list_resourceskeyspaces_list_onlySELECTregion
get_resourcekeyspacesSELECTIdentifier, region

SELECT examples

Gets all properties from an individual keyspace.

SELECT
region,
keyspace_name,
tags,
replication_specification,
client_side_timestamps_enabled
FROM awscc.cassandra.keyspaces
WHERE
region = '{{ region }}' AND
Identifier = '{{ keyspace_name }}';

INSERT example

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

/*+ create */
INSERT INTO awscc.cassandra.keyspaces (
,
region
)
SELECT
'{{ }}',
'{{ 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 keyspace resource, using stack-deploy.

/*+ update */
UPDATE awscc.cassandra.keyspaces
SET PatchDocument = string('{{ {
"Tags": tags,
"ReplicationSpecification": replication_specification,
"ClientSideTimestampsEnabled": client_side_timestamps_enabled
} | generate_patch_document }}')
WHERE
region = '{{ region }}' AND
Identifier = '{{ keyspace_name }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;

DELETE example

/*+ delete */
DELETE FROM awscc.cassandra.keyspaces
WHERE
Identifier = '{{ keyspace_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 keyspaces resource, the following permissions are required:

cassandra:Create,
cassandra:CreateMultiRegionResource,
cassandra:Select,
cassandra:SelectMultiRegionResource,
cassandra:TagResource,
cassandra:TagMultiRegionResource,
iam:CreateServiceLinkedRole