Building Serverless Web Applications
上QQ阅读APP看书,第一时间看更新

AWS CLI

The CLI is the command-line interface. For experienced users, it's a great tool to access information and manage resources. If you already have Python installed, you just need to run pip, which is the default package manager for Python, to install the CLI:

    pip install awscli

The configuration of the CLI is very similar to the one used by the SDK. The only difference is that you need to add another environment variable: AWS_DEFAULT_REGION. You need this because the SDK uses AWS_REGION instead of the AWS_DEFAULT_REGION variable.

To test if your setup is correct, you can execute the ls (list) command to list S3 buckets:

    aws s3 ls

Considering an AWS account with one bucket, the preceding command line derives the following output: