Connect to Amazon Keyspaces using Amazon CloudShell from the console - Amazon Keyspaces (for Apache Cassandra)
Services or capabilities described in Amazon Web Services documentation might vary by Region. To see the differences applicable to the China Regions, see Getting Started with Amazon Web Services in China (PDF).

Connect to Amazon Keyspaces using Amazon CloudShell from the console

Amazon CloudShell provides a streamlined way to connect to Amazon Keyspaces directly from the console. The Amazon CloudShell integration automatically initializes the cqlsh-expansion for you and establishes a connection to a specific keyspace.

Getting started with Amazon CloudShell integration

  1. Access the Amazon CloudShell integration – From the Amazon Keyspaces console, navigate to the keyspace you want to connect to and choose the Connect to Keyspaces Amazon CloudShell button.

  2. Pre-filled setup command – When you choose the Amazon CloudShell button, the system provides a pre-filled command that includes the necessary initialization and connection parameters:

    cqlsh-expansion.init ; cqlsh-expansion cassandra.region.amazonaws.com 9142 --ssl -my_keyspace
  3. Click Run

  4. Wait for Amazon Keyspaces to establish the connection – Allow time for the setup process to complete and the connection to your selected keyspace to be established.

  5. Execute commands – When connected, you can write and execute CQL commands directly against the selected keyspace.

Available CQLSH commands

The Amazon CloudShell integration provides access to standard CQLSH functionality, including support for commands beyond basic CQL.

  • Describe – List and view detailed descriptions of keyspaces and tables.

  • Copy – Export query output to a file for later processing.

  • Source – Execute CQL statements from a file.

  • Command history navigation – Scroll through previous commands using keyboard shortcuts.

  • Query execution – Run queries directly from the keyboard interface.

  • Output copying – Copy results as simple text for use in other applications.

Feature considerations

When using the Amazon CloudShell integration, consider the following trade-offs.

The following features are not supported:

  • CQL syntax suggestions and auto-complete functionality.

  • Editor tools such as show autocomplete, show tooltip, find, find and replace, redo, toggle block comments, toggle code folding, toggle line comment, and undo.

Modified functionality:

  • CSV downloads – To download results as CSV format, specify the > operator to pipe command output:

    SELECT * FROM my_table > file_name.csv
  • JSON viewing - You can view items in JSON format without requiring data conversion.

  • Terminal-style interface - The experience operates as a terminal interface rather than a full-featured code editor.

The Amazon CloudShell integration simplifies the connection process while providing essential CQL functionality for managing your Amazon Keyspaces data directly from the Amazon Web Services Management Console.