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 | awscc.cassandra.keyspaces |
Fields
- get (all properties)
- list (identifiers only)
| 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. |
| Name | Datatype | Description |
|---|---|---|
keyspace_name | string | Name for Cassandra keyspace |
region | string | AWS region. |
For more information, see AWS::Cassandra::Keyspace.
Methods
| Name | Resource | Accessible by | Required Params |
|---|---|---|---|
create_resource | keyspaces | INSERT | , region |
delete_resource | keyspaces | DELETE | Identifier, region |
update_resource | keyspaces | UPDATE | Identifier, PatchDocument, region |
list_resources | keyspaces_list_only | SELECT | region |
get_resource | keyspaces | SELECT | Identifier, region |
SELECT examples
- get (all properties)
- list (identifiers only)
Gets all properties from an individual keyspace.
SELECT
region,
keyspace_name,
tags,
replication_specification,
client_side_timestamps_enabled
FROM awscc.cassandra.keyspaces
WHERE
region = 'us-east-1' AND
Identifier = '{{ keyspace_name }}';
Lists all keyspaces in a region.
SELECT
region,
keyspace_name
FROM awscc.cassandra.keyspaces_list_only
WHERE
region = 'us-east-1';
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 awscc.cassandra.keyspaces (
,
region
)
SELECT
'{{ }}',
'{{ region }}';
/*+ create */
INSERT INTO awscc.cassandra.keyspaces (
KeyspaceName,
Tags,
ReplicationSpecification,
ClientSideTimestampsEnabled,
region
)
SELECT
'{{ keyspace_name }}',
'{{ tags }}',
'{{ replication_specification }}',
'{{ client_side_timestamps_enabled }}',
'{{ region }}';
version: 1
name: stack name
description: stack description
providers:
- aws
globals:
- name: region
value: '{{ vars.AWS_REGION }}'
resources:
- name: keyspace
props:
- name: keyspace_name
value: '{{ keyspace_name }}'
- name: tags
value:
- key: '{{ key }}'
value: '{{ value }}'
- name: replication_specification
value:
replication_strategy: '{{ replication_strategy }}'
region_list:
- '{{ region_list[0] }}'
- name: client_side_timestamps_enabled
value: '{{ client_side_timestamps_enabled }}'
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 }}';
DELETE example
/*+ delete */
DELETE FROM awscc.cassandra.keyspaces
WHERE
Identifier = '{{ keyspace_name }}' AND
region = 'us-east-1';
Permissions
To operate on the keyspaces resource, the following permissions are required:
- Create
- Read
- Update
- Delete
- List
cassandra:Create,
cassandra:CreateMultiRegionResource,
cassandra:Select,
cassandra:SelectMultiRegionResource,
cassandra:TagResource,
cassandra:TagMultiRegionResource,
iam:CreateServiceLinkedRole
cassandra:Select,
cassandra:SelectMultiRegionResource
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
cassandra:Drop,
cassandra:DropMultiRegionResource,
cassandra:Select,
cassandra:SelectMultiRegionResource
cassandra:Select,
cassandra:SelectMultiRegionResource