awscli-local is a thin Python wrapper around the standard 'aws' command-line interface (CLI) that enables seamless interaction with LocalStack, a cloud service emulator. It allows developers to execute AWS CLI commands against their local LocalStack instance without needing to explicitly specify the `--endpoint-url` parameter. The current version is 0.22.2, and it is actively maintained by the LocalStack team, receiving regular updates.
pip install awscli-local[ver1]No compatibility data collected yet for this library.
This quickstart demonstrates creating and listing an S3 bucket using the `awslocal` command, assuming LocalStack is already running on your machine. This eliminates the need for `--endpoint-url` on most commands.
Use `pip install awscli-local[ver1]` to install the wrapper with AWS CLI v1. If AWS CLI v2 is desired, install it separately (e.g., using the official AWS installer) and ensure `awslocal`'s PATH is correctly configured. Be aware of known limitations, particularly for CloudFormation.
Ensure the directory where `awslocal` is installed (e.g., `~/.local/bin` for user installs, or a virtual environment's `bin` directory) is included in your PATH. Reload your shell by sourcing its configuration file (e.g., `source ~/.bashrc` or `source ~/.zshrc`) or by opening a new terminal window.
Use the `AWS_ENDPOINT_URL` environment variable (e.g., `export AWS_ENDPOINT_URL=http://localhost:4566`) instead of `LOCALSTACK_HOST` or `USE_SSL`.
The recommended workaround is to downgrade to AWS CLI v1 for `cloudformation` commands by installing `awscli-local[ver1]`. Alternatively, for advanced use cases, consider directly interacting with LocalStack's S3 service for asset storage.
Ensure the installation directory is in your PATH, or use the full path to 'awslocal'.
Escape the brackets or quote the package name: pip install 'awscli-local[ver1]'
Reinstall the AWS CLI: python3 -m pip install --upgrade --force-reinstall awscli
Ensure your LocalStack instance is running. Verify that `LOCALSTACK_HOST` or `AWS_ENDPOINT_URL` environment variables are correctly set (e.g., `export LOCALSTACK_HOST=localhost:4566`) or that LocalStack is accessible on the default `localhost:4566`. Check for any local firewall rules blocking the connection.
For installation, try running with `sudo` if on Linux/macOS (`sudo pip install awscli-local`). If the issue occurs during execution, check and adjust file/directory permissions for the `awslocal` executable and the `.aws` configuration directory (e.g., `chmod -R 755 /usr/local/aws-cli` for common Linux installations).