Skip to main content

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 not supported, because there is no official PyPI package for v2. awslocal still works with AWS CLI v2 if you install it yourself (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:

  • AWS_ENDPOINT_URL: The endpoint URL to connect to (takes precedence over USE_SSL/LOCALSTACK_HOST below). Useful when you have LocalStack bound to a different host (e.g., within docker-compose).
  • LOCALSTACK_HOST (deprecated): A : variable defining where to find LocalStack (default: localhost:4566).
  • USE_SSL (deprecated): Whether to use SSL when connecting to LocalStack (default: False).
  • DISABLE_DEPRECATION_NOTICE: Set to 1 to hide the deprecation notice (default: unset).

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

  • Follow the official guide on setting up the command completion for the aws CLI: https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-completion.html

  • While enabling the command completion for your shell, make sure to register the completion for awslocal as well.

    For example, if you are using bash, you would add the following commands to your ~/.bashrc:

    complete -C '/usr/local/bin/aws_completer' aws
    complete -C '/usr/local/bin/aws_completer' awslocal
    
  • Follow the instructions for the shell you are using. For some shells you might need to register a different command or enable certain compatibility plugins (like zsh).

Limitations

  • Please note that there is a known limitation for using the cloudformation package ... command with the AWS CLI v2. Currently it is not possible to specify the S3 endpoint URL, and this issue is not yet resolved on AWS side. The problem is that the AWS CLI v2 is not available as a package on pypi.org, but is instead shipped as a binary package that cannot be easily patched from awslocal. To work around this issue, you have 2 options:

    • Downgrade to the v1 AWS CLI (this is the recommended approach)
    • There is an inofficial way to install AWS CLI v2 from sources. We do not recommend this, but it is technically possible. Also, you should install these libraries in a Python virtualenv, to avoid version clashes with other libraries on your system:
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

  • v0.23.0: Print a deprecation notice that points to lstk aws
  • v0.22.2: Display full stack traces only in --debug mode; non-debug runs now show concise error messages, consistent with awscli behavior.
  • v0.22.1: Fix issue with cfn package and cfn deploy with awscli >= 1.41.9
  • v0.22.0: Use fallback for endpoint detection. Should prevent most cases of Unable to find LocalStack endpoint for service ...
  • v0.21.1: Introducing semantic versioning and list of services without endpoints
  • v0.21: Use placeholder credentials and region only if Boto cannot not find them, fix output streaming for logs tail call
  • v0.20: Small fixes for Python 2.x backward compatibility
  • v0.19: Patch botocore to skip adding data- host prefixes to endpoint URLs
  • v0.18: Pass SYSTEMROOT env variable to fix "_Py_HashRandomization_Init" error on Windows
  • v0.17: Remove obsolete/erroneous FORCE_V2 flag
  • v0.16: Minor fix reading addressing_style in profile config
  • v0.15: Fix lookup of v1/v2 AWS CLI version, apply --s3-endpoint-url only for v1
  • v0.14: Quote file name for windows to allow folder names with spaces
  • v0.13: Fix extra requires for newer pip versions
  • v0.12: Support v1 and v2 of underlying awscli installation
  • v0.9: Add --s3-endpoint-url by default to fix "cloudformation package" command
  • v0.9: Support for DEFAULT_REGION environment variable
  • v0.8: Switch to using edge port for all service endpoints by default
  • v0.7: Apply runtime patch to aws-cli to enable --s3-endpoint-url CloudFormation parameter
  • v0.6: Start aws CLI command in-memory instead of calling external process
  • v0.5: Support piping binary files to stdout; add .bat file for Windows
  • v0.4: Minor fix for Python 3 compatibility
  • v0.3: Add support for additional service endpoints
  • v0.2: Enable SSL connections; refactor code
  • v0.1: Initial release

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).

Metadata

Release files for awscli-local 0.23.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for awscli-local 0.23.0
File Size Uploaded Provenance Actions
awscli_local-0.23.0.tar.gz 12.3 kB Without provenance Details for awscli_local-0.23.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for awscli-local 0.23.0
File Interpreter ABI Platform Actions
awscli_local-0.23.0-py3-none-any.whl Python 3 none any Details for awscli_local-0.23.0-py3-none-any.whl

Total release size: 25.3 kB

Release files / awscli_local-0.23.0.tar.gz

Download URL awscli_local-0.23.0.tar.gz
Size 12.3 kB
Tags Source
SHA-256 checksum
How to use checksums
59aa31190d578967a4d376440320810e00ffd7dabba5dcb9eab6ae7a4c633441
BLAKE2b-256 checksum
How to use checksums
b156fb8eed90e00285f34ba97239c94c63daa963ce1746d2a99b2f66b893ba92
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.8

Release files / awscli_local-0.23.0-py3-none-any.whl

Download URL awscli_local-0.23.0-py3-none-any.whl
Size 13.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
43f53d549286d649277eb26bcf0c8891a337834f5adde99478f5bb3775214a00
BLAKE2b-256 checksum
How to use checksums
655a3545f4877ad0898c4998a67ba3b1a5f6f6748d437259597af2c5bd89e9f7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.8

Security for awscli-local 0.23.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page