AWS CloudShell

AWS CloudShell is a browser-based shell that makes it easy to securely manage, explore, and interact with your AWS resources. It is pre-authenticated with your console credentials and common development and administration tools are pre-installed, so no local installation or configuration is needed. You can use AWS CloudShell to run commands with the AWS Command Line Interface (AWS CLI), experiment with AWS service APIs using the AWS SDKs, or use a variety of other tools such as Git, jq, zsh, and Bash.

In this blog post, I will show you how to get started with AWS CloudShell and some of its features and benefits.

To launch AWS CloudShell, simply click on the shell icon in the top right corner of the AWS Management Console. This will open a new tab with a shell prompt where you can start typing commands. You can also use keyboard shortcuts to open and close the shell tab.

AWS CloudShell provides you with 1 GB of persistent storage per AWS Region. This means that any files or directories that you create in your home directory (/home/cloudshell-user) will be saved across sessions and available in any Availability Zone in the same Region. You can also access this storage from other AWS services using the Amazon Elastic File System (Amazon EFS) API.

One of the advantages of AWS CloudShell is that it comes with many tools and utilities pre-installed, such as:

  • AWS CLI version 2
  • AWS SDKs for Python, JavaScript, Java, .NET, Go, Ruby, PHP, and C++
  • Git and GitHub CLI
  • jq and yq for processing JSON and YAML files
  • zsh and Bash shells with common plugins and completions
  • vim, emacs, and nano editors
  • curl, wget, telnet, and ping networking tools
  • zip, unzip, tar, gzip, and bzip2 compression tools
  • aws-shell and aws-sam-cli for enhanced AWS CLI and AWS Serverless Application Model (AWS SAM) experiences

You can use these tools to perform various tasks with your AWS resources, such as:

  • Create, update, and delete AWS resources using the AWS CLI or the AWS SDKs
  • Clone, pull, and push code repositories using Git or GitHub CLI
  • Query and manipulate JSON and YAML files using jq and yq
  • Edit files using your preferred editor
  • Test network connectivity using curl, wget, telnet, or ping
  • Compress and decompress files using zip, unzip, tar, gzip, or bzip2
  • Explore new features and services using aws-shell or aws-sam-cli

AWS CloudShell also supports customizing your shell environment to suit your preferences. You can change the shell theme, font size, keyboard layout, and key bindings. You can also install additional tools using the sudo command. For example, you can install Node.js using the following commands:

sudo curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.38.0/install.sh | bash
source ~/.bashrc
nvm install node

Note that any tools that you install using sudo will not be persisted across sessions and will need to be reinstalled every time you launch a new shell.

AWS CloudShell is a convenient and powerful way to interact with your AWS resources from your browser. It eliminates the need for local installation and configuration of tools and provides you with a consistent and secure environment. You can use it for a variety of tasks such as development, administration, experimentation, and learning. To learn more about AWS CloudShell, visit the documentation page or watch this video.