Package: awscli-local
LocalStack AWS CLIThis package provides theawslocalcommand, which is a thin wrapper around theawscommand line interface for use withLocalStack.InstallationYou can install theawslocalcommand viapip: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 ofawscli(e.g.,v1/v2) and install the wrapper script only:pip install awscli-localNote:Automatic installation of AWS CLI version 2 is currently not supported yet (at the time of writing there is no official pypi package forv2available), but theawslocaltechnically also works with AWS CLI v2 (seethis sectionfor more details).UsageTheawslocalcommand has the same usage as theawscommand. For detailed usage, please refer to the manual pages ofaws help.ExampleInstead of the following command ...aws --endpoint-url=http://localhost:4566 kinesis list-streams... you can simply use this:awslocal kinesis list-streamsConfigurationsYou can use the following environment variables for configuration:AWS_ENDPOINT_URL: The endpoint URL to connect to (takes precedence overUSE_SSL/LOCALSTACK_HOSTbelow).
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).Completionawscliprovides a neat command completion feature which is compatible with most modern shells which can also be used withawslocal.Usage instructionsThe command completion will automatically suggest commands and parameters when using the completion key (which is typically theTabkey):$awslocaldynamodbd<TAB>
delete-backupdescribe-global-table
delete-itemdescribe-global-table-settings
delete-tabledescribe-limits
describe-backupdescribe-table
describe-continuous-backupsdescribe-table-replica-auto-scaling
describe-contributor-insightsdescribe-time-to-live
describe-endpointsConfigurationFollow the official guide on setting up the command completion for theawsCLI:https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-completion.htmlWhile enabling the command completion for your shell,make sure to register the completion forawslocalas well.For example, if you are usingbash, you would add the following commands to your~/.bashrc:complete-C'/usr/local/bin/aws_completer'awscomplete-C'/usr/local/bin/aws_completer'awslocalFollow the instructions for the shell you are using. For some shells you might need to register a different command or enable certain compatibility plugins (likezsh).LimitationsPlease note that there is a known limitation for using thecloudformation package ...command with the AWS CLI v2. Currently it is not possible to specify the S3 endpoint URL, and this issue isnot yet resolvedon AWS side. The problem is that the AWS CLI v2 isnot available as a package on pypi.org, but is instead shipped as a binary package that cannot be easily patched fromawslocal. 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
pipinstallhttps://github.com/boto/botocore/archive/v2.ziphttps://github.com/aws/aws-cli/archive/v2.zipChange Logv0.22.0: Use fallback for endpoint detection. Should prevent most cases ofUnable to find LocalStack endpoint for service ...v0.21.1: Introducing semantic versioning and list of services without endpointsv0.21: Use placeholder credentials and region only if Boto cannot not find them, fix output streaming for logs tail callv0.20: Small fixes for Python 2.x backward compatibilityv0.19: Patch botocore to skip addingdata-host prefixes to endpoint URLsv0.18: PassSYSTEMROOTenv variable to fix "_Py_HashRandomization_Init" error on Windowsv0.17: Remove obsolete/erroneous FORCE_V2 flagv0.16: Minor fix reading addressing_style in profile configv0.15: Fix lookup of v1/v2 AWS CLI version, apply --s3-endpoint-url only for v1v0.14: Quote file name for windows to allow folder names with spacesv0.13: Fix extra requires for newer pip versionsv0.12: Support v1 and v2 of underlyingawscliinstallationv0.9: Add--s3-endpoint-urlby default to fix "cloudformation package" commandv0.9: Support forDEFAULT_REGIONenvironment variablev0.8: Switch to using edge port for all service endpoints by defaultv0.7: Apply runtime patch to aws-cli to enable--s3-endpoint-urlCloudFormation parameterv0.6: StartawsCLI command in-memory instead of calling external processv0.5: Support piping binary files to stdout; add .bat file for Windowsv0.4: Minor fix for Python 3 compatibilityv0.3: Add support for additional service endpointsv0.2: Enable SSL connections; refactor codev0.1: Initial releaseAlternativeThis package can be replaced by a single bash alias, except forcloudformation package ...as this command requires an additional--s3-endpoint-urlparameter: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"LicenseThis software library is released under the Apache License, Version 2.0 (seeLICENSE).