Home

Awesome

LocalStack AWS CLI

PyPI version

This package provides the awslocal command, which is a thin wrapper around the aws command line interface for use with LocalStack.

Installation

You can install the awslocal command via pip:

pip install awscli-local[ver1]

If you're on macOS or use ZSH, please use the following command to install awslocal via pip:

pip install "awscli-local[ver1]"

Note that the command above also installs the latest version of the underlying AWS CLI version 1 (awscli) package. Use this command if you prefer to manage your own version of awscli (e.g., v1/v2) and install the wrapper script only:

pip install awscli-local

Note: Automatic installation of AWS CLI version 2 is currently not supported yet (at the time of writing there is no official pypi package for v2 available), but the awslocal technically also works with AWS CLI v2 (see this section for more details).

Usage

The awslocal command has the same usage as the aws command. For detailed usage, please refer to the manual pages of aws help.

Example

Instead of the following command ...

aws --endpoint-url=http://localhost:4566 kinesis list-streams

... you can simply use this:

awslocal kinesis list-streams

Configurations

You can use the following environment variables for configuration:

Completion

awscli provides a neat command completion feature which is compatible with most modern shells which can also be used with awslocal.

Usage instructions

The command completion will automatically suggest commands and parameters when using the completion key (which is typically the Tab key):

$ awslocal dynamodb d<TAB>
delete-backup                        describe-global-table
delete-item                          describe-global-table-settings
delete-table                         describe-limits
describe-backup                      describe-table
describe-continuous-backups          describe-table-replica-auto-scaling
describe-contributor-insights        describe-time-to-live
describe-endpoints

Configuration

Limitations

virtualenv .venv
. .venv/bin/activate
pip install https://github.com/boto/botocore/archive/v2.zip https://github.com/aws/aws-cli/archive/v2.zip

Change Log

Alternative

This package can be replaced by a single bash alias, except for cloudformation package ... as this command requires an additional --s3-endpoint-url parameter:

alias awslocal="AWS_ACCESS_KEY_ID=test AWS_SECRET_ACCESS_KEY=test AWS_DEFAULT_REGION=${DEFAULT_REGION:-$AWS_DEFAULT_REGION} aws --endpoint-url=http://${LOCALSTACK_HOST:-localhost}:4566"

License

This software library is released under the Apache License, Version 2.0 (see LICENSE).