AWS CloudShell Concepts - AWS CloudShell (original) (raw)

This section describes how to interact with AWS CloudShell and perform specific actions with supported applications.

Topics

You can navigate CloudShell interface features from the AWS Management Console and Console Toolbar.

The following screenshot indicates several key AWS CloudShell interface features.

Key features of the AWS CloudShell interface.

  1. AWS CloudShell command line interface that you use to run commands by using your preferred shell. The current shell type is indicated by the command prompt.
  2. The terminal tab, which uses AWS Region where AWS CloudShell is currently running.
  3. The + icon is a dropdown menu that includes options to create, restart, and delete environments.
  4. The Actions menu, which provides options for changing the screen layout, downloading and uploading files, restarting your AWS CloudShell, and deleting your AWS CloudShell home directory.
Note

The Download option isn't available when you launch CloudShell on the Console Toolbar. 5. The Open in new browser tab, which provides the option to access your CloudShell session in a full screen. 6. The Preferences option, which you can use to customize your shell experience. 7. The bottom bar, which provides the following options to:

Note

The Feedback option isn't available when you launch CloudShell on the Console Toolbar.

Working in AWS Regions

The current AWS Region that you're running in is displayed as a tab.

You can choose an AWS Region to work in by selecting a specific Region using the Region selector. After you change Regions, the interface refreshes as your shell session connects to a different compute environment that's running in the selected Region.

Important

Specifying your default AWS Region for AWS CLI

You can use environment variables to specify configuration options and credentials required to access AWS services using AWS CLI. The environment variable that specifies the default AWS Region for your shell session is set in either when you launch AWS CloudShell from a specific Region in the AWS Management Console or when you choose an option in the Region selector.

Environment variables have precedence over AWS CLI credentials files that are updated by aws configure. So, you can't run the aws configure command to change the Region that's specified by the environment variable. Instead, to change the default Region for AWS CLI commands, assign a value to theAWS_REGION environment variable. In the examples that follow, replaceus-east-1 with the Region that you're in.

Bash or Zsh

$ export AWS_REGION=us-east-1

Setting the environment variable changes the value that's used until either at the end of your shell session or when you set the variable to a different value. You can set variables in your shell's startup script to make the variables persistent across future sessions.

PowerShell

PS C:\> $Env:AWS_REGION="us-east-1"

If you set an environment variable at the PowerShell prompt, the environment variable saves the value for only the duration of the current session. Alternatively, you can set the variable for all future PowerShell sessions by adding the variable to your PowerShell profile. For more information about storing environment variables, see the PowerShell documentation.

To confirm that you've changed the default Region, run the aws configure list command to display the current AWS CLI configuration data.

Note

For specific AWS CLI commands, you can override the default Region using the command line option --region. For more information, see Command line options in the_AWS Command Line Interface User Guide_.

Working with files and storage

Using AWS CloudShell's interface, you can upload files to and download files from the shell environment. For more information about downloading and uploading files, see Getting started with AWS CloudShell.

To ensure any of the files you add are available after your session ends, you should know the difference between persistent and temporary storage.

Important

Make sure to leave files that you want to keep and use for future shell sessions in your home directory. For example, suppose that you move a file out of your home directory by running the mv command. Then, that file is recycled when the current shell session ends.

Access CloudShell in the Console Mobile Application

You can access CloudShell in the AWS Console Mobile Application from the home screen. From the home screen, you can view information about CloudShell and other AWS services. For more information, see Getting started with the AWS Console Mobile Application. To launch CloudShell in the AWS Console Mobile Application, choose one of the following options:

You can exit CloudShell at any time by choosing X.

For more information about accessing CloudShell in Console Mobile Application, see Access AWS CloudShell.

Note

Currently, you cannot create or launch VPC environments in the AWS Console Mobile Application.

Working with Docker

AWS CloudShell fully supports Docker without installation or configuration. You can define, build and run Docker containers inside AWS CloudShell. You can deploy Docker-based resources, such as Lambda functions based on Docker containers, via the AWS CDK Toolkit as well as build Docker containers and push them to Amazon ECR repositories via the Docker CLI. For detailed steps on how to run both of these deployments, see the following tutorials:

There are certain restrictions and limitations with using Docker with AWS CloudShell: