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 = '{{ region }}' AND
Identifier = '{{ keyspace_name }}';
Lists all keyspaces in a region.
SELECT
region,
keyspace_name
FROM awscc.cassandra.keyspaces_list_only
WHERE
region = '{{ region }}';
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 }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;
/*+ create */
INSERT INTO awscc.cassandra.keyspaces (
KeyspaceName,
Tags,
ReplicationSpecification,
ClientSideTimestampsEnabled,
region
)
SELECT
'{{ keyspace_name }}',
'{{ tags }}',
'{{ replication_specification }}',
'{{ client_side_timestamps_enabled }}',
'{{ region }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;
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 }}'
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:
| Parameter | Description |
|---|---|
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:
- 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