You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This repository provides a Docker image for common tooling for Amazon Keyspaces. Keyspaces for functional testing, light operations, and data migration.
4
-
5
-
The toolkit is optimized for Amazon Keyspaces, but will also work with Apache Cassandra clusters.
3
+
This repository provides common tooling for Amazon Keyspaces for functional testing, light operations, and data migration. The tooling is packaged as a Docker image or python package to simplify setup and configuration. The toolkit is optimized for Amazon Keyspaces, but will also work with Apache Cassandra clusters.
6
4
7
5
## Amazon Keyspaces (for Apache Cassandra)
8
6
[Amazon Keyspaces](https://aws.amazon.com/keyspaces/) is a scalable, highly available, and managed Apache Cassandra–compatible database service. Amazon Keyspaces is serverless, so you pay for only the resources you use and the service can automatically scale tables up and down in response to application traffic.
9
7
10
8
## What's included
11
9
This container extends from [awscli container](https://aws.amazon.com/blogs/developer/aws-cli-v2-docker-image/) and includes the following Cassandra components:
12
10
* 3.11.6 Apache Cassandra distribution of CQLSH
11
+
* cqlsh expansion that integrates sigv4 authentication
13
12
* Amazon Web Services pem file for SSL connectivity
14
13
* CQLSHRC file with best practices
15
14
* Helpers/examples to perform to common task
16
15
* AWS CLI. Official Documentation [See How to use the AWSCLI Container](https://aws.amazon.com/blogs/developer/aws-cli-v2-docker-image/)
17
-
* optional cqlsh expansion that integrates sigv4 authentication
@@ -26,30 +25,49 @@ This container extends from [awscli container](https://aws.amazon.com/blogs/deve
26
25
* Extends from AWS CLI Container Image and can be accessed via overriding the [entrypoint](https://docs.docker.com/engine/reference/builder/#entrypoint) parameter
27
26
28
27
# TLDR;
29
-
The following steps to connect to Amazon Keyspaces using the Toolkit. Clone. Build Image. Connect to Keyspaces and Go!
28
+
The following steps to connect to Amazon Keyspaces using the Toolkit.
30
29
30
+
## Docker
31
+
Clone the github repoistory, Build Docker Image, Connect to Keyspaces, and Go!
The toolkit contains a version of cqlsh that extends Authentication functionality to leverage the [Sigv4 athentication plugin for the Python Cassandra driver](https://github.com/aws/aws-sigv4-auth-cassandra-python-driver-plugin). This plugin enables IAM users, roles, and federated identities to add authentication information to Amazon Keyspaces (for Apache Cassandra) API requests using the AWS Signature Version 4 Process (SigV4). You can leverage this functionality by passing "cqlsh-expansion" to the ```--entrypoint``` docker run parameter, and the ```--auth-provider "SigV4AuthProvider"``` flag to the cqlsh-expansion process. You can use the docker container host's credentials by mounting the AWS CLI configuration directory to the container using the mount command ```-v```. If your AWS configuration is stored in ~/.aws then the Docker mount command would be `-v ~/.aws:/root/.aws`.
50
+
The toolkit contains a version of cqlsh that extends Authentication functionality to leverage the [Sigv4 athentication plugin for the Python Cassandra driver](https://github.com/aws/aws-sigv4-auth-cassandra-python-driver-plugin). This plugin enables IAM users, roles, and federated identities to add authentication information to Amazon Keyspaces (for Apache Cassandra) API requests using the AWS Signature Version 4 Process (SigV4). You can leverage this functionality by passing the ```--auth-provider "SigV4AuthProvider"``` flag to the cqlsh-expansion process. You can use the docker container host's credentials by mounting the AWS CLI configuration directory to the container using the mount command ```-v```. If your AWS configuration is stored in ~/.aws then the Docker mount command would be `-v ~/.aws:/root/.aws`.
Service-specific credentials enable IAM users to access a specific AWS service. The credentials cannot be used to access other AWS services. They are associated with a specific IAM user and cannot be used by other IAM users.
51
-
52
-
* See official documentation for IAM user [Generated service-specific credentials](https://docs.aws.amazon.com/keyspaces/latest/devguide/programmatic.credentials.html) for Amazon Keyspaces
70
+
If you are using the Service-specific credentials for IAM users to access Amazon Keyspaces. See official documentation for IAM user [Generated service-specific credentials](https://docs.aws.amazon.com/keyspaces/latest/devguide/programmatic.credentials.html) for Amazon Keyspaces
53
71
54
72
55
73
### Setup Docker
@@ -69,7 +87,7 @@ The following section will provide examples of CQLSH usage with Apache Cassandra
69
87
The following command will clone this repository and pull down submodules
Keyspace and table creation are Asynchronous in Amazon Keyspaces. This asynchronous functionality is different than Apache Cassandra where table creation is synchronous. We have been told by customers that some existing scripts require synchronous behavior when creating a table. A common solution is to add an exponential backoff describe statement to notify users when the table is created. This container contains an exponential backoff helper that will attempt multiple times until the CQL statement succeeds. Other options include building a CloudFormation template.
226
+
Keyspace and table creation are Asynchronous in Amazon Keyspaces. This asynchronous functionality is different than Apache Cassandra where table creation is synchronous. We have been told by customers that some existing scripts require synchronous behavior when creating a table. A common solution is to add an exponential backoff describe statement to notify users when the table is created. This container contains an exponential backoff helper that will attempt multiple times until the CQL statement succeeds.
209
227
210
228
`Parameters`
211
229
* $1 maximum time for program to run in seconds
@@ -216,7 +234,7 @@ Keyspace and table creation are Asynchronous in Amazon Keyspaces. This asynchron
216
234
#!/bin/bash
217
235
218
236
#create a table
219
-
docker run -ti --name createtablec amazon/keyspaces-toolkit \
237
+
docker run -ti --name createtablec amazon/amazon-keyspaces-toolkit \
220
238
cassandra.us-east-1.amazonaws.com 9142 \
221
239
-u "SERVICEUSERNAME" -p "SERVICEPASSWORD" --ssl \
222
240
--execute "CREATE TABLE aws.workshop_backofftest(
@@ -235,7 +253,7 @@ docker rm createtablec
235
253
236
254
#exponential backoff describe
237
255
#run for 30 seconds or 120 attempts which ever comes first
238
-
docker run --rm -ti --entrypoint aws-cqlsh-expo-backoff.sh amazon/keyspaces-toolkit \
256
+
docker run --rm -ti --entrypoint aws-cqlsh-expo-backoff.sh amazon/amazon-keyspaces-toolkit \
0 commit comments