keyspaces
Creates, updates, deletes or gets a keyspace
resource or lists keyspaces
in a region
Overview
Name | keyspaces |
Type | Resource |
Description | Resource schema for AWS::Cassandra::Keyspace |
Id | aws.cassandra.keyspaces |
Fields
Name | Datatype | Description |
---|---|---|
keyspace_name | string | Name for Cassandra keyspace |
tags | array | |
replication_specification | object | |
client_side_timestamps_enabled | boolean | Indicates 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. |
region | string | AWS region. |
For more information, see AWS::Cassandra::Keyspace
.
Methods
Name | Accessible by | Required Params |
---|---|---|
create_resource | INSERT | , 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 keyspaces
in a region.
SELECT
region,
keyspace_name,
tags,
replication_specification,
client_side_timestamps_enabled
FROM aws.cassandra.keyspaces
WHERE region = 'us-east-1';
Gets all properties from an individual keyspace
.
SELECT
region,
keyspace_name,
tags,
replication_specification,
client_side_timestamps_enabled
FROM aws.cassandra.keyspaces
WHERE region = 'us-east-1' AND data__Identifier = '<KeyspaceName>';
INSERT
example
Use the following StackQL query and manifest file to create a new keyspace
resource, using stack-deploy
.
- Required Properties
- All Properties
- Manifest
/*+ create */
INSERT INTO aws.cassandra.keyspaces (
,
region
)
SELECT
'{{ }}',
'{{ region }}';
/*+ create */
INSERT INTO aws.cassandra.keyspaces (
KeyspaceName,
Tags,
ReplicationSpecification,
ClientSideTimestampsEnabled,
region
)
SELECT
'{{ KeyspaceName }}',
'{{ Tags }}',
'{{ ReplicationSpecification }}',
'{{ ClientSideTimestampsEnabled }}',
'{{ region }}';
version: 1
name: stack name
description: stack description
providers:
- aws
globals:
- name: region
value: '{{ vars.AWS_REGION }}'
resources:
- name: keyspace
props:
- name: KeyspaceName
value: '{{ KeyspaceName }}'
- name: Tags
value:
- Key: '{{ Key }}'
Value: '{{ Value }}'
- name: ReplicationSpecification
value:
ReplicationStrategy: '{{ ReplicationStrategy }}'
RegionList:
- '{{ RegionList[0] }}'
- name: ClientSideTimestampsEnabled
value: '{{ ClientSideTimestampsEnabled }}'
DELETE
example
/*+ delete */
DELETE FROM aws.cassandra.keyspaces
WHERE data__Identifier = '<KeyspaceName>'
AND region = 'us-east-1';
Permissions
To operate on the keyspaces
resource, the following permissions are required:
Create
cassandra:Create,
cassandra:CreateMultiRegionResource,
cassandra:Select,
cassandra:SelectMultiRegionResource,
cassandra:TagResource,
cassandra:TagMultiRegionResource,
iam:CreateServiceLinkedRole
Read
cassandra:Select,
cassandra:SelectMultiRegionResource
Update
cassandra:Alter,
cassandra:AlterMultiRegionResource,
cassandra:Modify,
cassandra:ModifyMultiRegionResource,
cassandra:Select,
cassandra:SelectMultiRegionResource,
cassandra:TagResource,
cassandra:TagMultiRegionResource,
cassandra:UntagResource,
cassandra:UntagMultiRegionResource,
application-autoscaling:RegisterScalableTarget,
application-autoscaling:DeregisterScalableTarget,
application-autoscaling:DescribeScalableTargets,
application-autoscaling:DescribeScalingPolicies,
application-autoscaling:PutScalingPolicy,
cloudwatch:DeleteAlarms,
cloudwatch:DescribeAlarms,
cloudwatch:PutMetricAlarm,
iam:CreateServiceLinkedRole
Delete
cassandra:Drop,
cassandra:DropMultiRegionResource,
cassandra:Select,
cassandra:SelectMultiRegionResource
List
cassandra:Select,
cassandra:SelectMultiRegionResource