Giter Club home page Giter Club logo

awscli-local's Introduction

โšก We are thrilled to announce the release of LocalStack 3.6 โšก

LocalStack - A fully functional local cloud stack

CircleCI Coverage Status PyPI Version Docker Pulls PyPi downloads Backers on Open Collective Sponsors on Open Collective PyPI License Code style: black Ruff Twitter

LocalStack is a cloud software development framework to develop and test your AWS applications locally.

Overview โ€ข Install โ€ข Quickstart โ€ข Run โ€ข Usage โ€ข Releases โ€ข Contributing
๐Ÿ“– Docs โ€ข ๐Ÿ’ป Pro version โ€ข โ˜‘๏ธ LocalStack coverage


Overview

LocalStack is a cloud service emulator that runs in a single container on your laptop or in your CI environment. With LocalStack, you can run your AWS applications or Lambdas entirely on your local machine without connecting to a remote cloud provider! Whether you are testing complex CDK applications or Terraform configurations, or just beginning to learn about AWS services, LocalStack helps speed up and simplify your testing and development workflow.

LocalStack supports a growing number of AWS services, like AWS Lambda, S3, Dynamodb, Kinesis, SQS, SNS, and many more! The Pro version of LocalStack supports additional APIs and advanced features. You can find a comprehensive list of supported APIs on our โ˜‘๏ธ Feature Coverage page.

LocalStack also provides additional features to make your life as a cloud developer easier! Check out LocalStack's User Guides for more information.

Install

The quickest way get started with LocalStack is by using the LocalStack CLI. It enables you to start and manage the LocalStack Docker container directly through your command line. Ensure that your machine has a functional docker environment installed before proceeding.

Brew (macOS or Linux with Homebrew)

Install the LocalStack CLI through our official LocalStack Brew Tap:

brew install localstack/tap/localstack-cli

Binary download (MacOS, Linux, Windows)

If Brew is not installed on your machine, you can download the pre-built LocalStack CLI binary directly:

  • Visit localstack/localstack-cli and download the latest release for your platform.
  • Extract the downloaded archive to a directory included in your PATH variable:
    • For MacOS/Linux, use the command: sudo tar xvzf ~/Downloads/localstack-cli-*-darwin-*-onefile.tar.gz -C /usr/local/bin

PyPI (MacOS, Linux, Windows)

LocalStack is developed using Python. To install the LocalStack CLI using pip, run the following command:

python3 -m pip install localstack

The localstack-cli installation enables you to run the Docker image containing the LocalStack runtime. To interact with the local AWS services, you need to install the awslocal CLI separately. For installation guidelines, refer to the awslocal documentation.

Important: Do not use sudo or run as root user. LocalStack must be installed and started entirely under a local non-root user. If you have problems with permissions in macOS High Sierra, install with pip install --user localstack

Quickstart

Start LocalStack inside a Docker container by running:

 % localstack start -d

     __                     _______ __             __
    / /   ____  _________ _/ / ___// /_____ ______/ /__
   / /   / __ \/ ___/ __ `/ /\__ \/ __/ __ `/ ___/ //_/
  / /___/ /_/ / /__/ /_/ / /___/ / /_/ /_/ / /__/ ,<
 /_____/\____/\___/\__,_/_//____/\__/\__,_/\___/_/|_|

 ๐Ÿ’ป LocalStack CLI 3.6.0
 ๐Ÿ‘ค Profile: default

[12:47:13] starting LocalStack in Docker mode ๐Ÿณ                       localstack.py:494
           preparing environment                                       bootstrap.py:1240
           configuring container                                       bootstrap.py:1248
           starting container                                          bootstrap.py:1258
[12:47:15] detaching                                                   bootstrap.py:1262

You can query the status of respective services on LocalStack by running:

% localstack status services
โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”ณโ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”“
โ”ƒ Service                  โ”ƒ Status      โ”ƒ
โ”กโ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ•‡โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”ฉ
โ”‚ acm                      โ”‚ โœ” available โ”‚
โ”‚ apigateway               โ”‚ โœ” available โ”‚
โ”‚ cloudformation           โ”‚ โœ” available โ”‚
โ”‚ cloudwatch               โ”‚ โœ” available โ”‚
โ”‚ config                   โ”‚ โœ” available โ”‚
โ”‚ dynamodb                 โ”‚ โœ” available โ”‚
...

To use SQS, a fully managed distributed message queuing service, on LocalStack, run:

% awslocal sqs create-queue --queue-name sample-queue
{
    "QueueUrl": "http://sqs.us-east-1.localhost.localstack.cloud:4566/000000000000/sample-queue"
}

Learn more about LocalStack AWS services and using them with LocalStack's awslocal CLI.

Running

You can run LocalStack through the following options:

Usage

To start using LocalStack, check out our documentation.

To use LocalStack with a graphical user interface, you can use the following UI clients:

Releases

Please refer to GitHub releases to see the complete list of changes for each release. For extended release notes, please refer to the LocalStack Discuss.

Contributing

If you are interested in contributing to LocalStack:

We are thankful for all the contributions and feedback we receive.

Get in touch

Get in touch with the LocalStack Team to report ๐Ÿž issues, upvote ๐Ÿ‘ feature requests, ๐Ÿ™‹๐Ÿฝ ask support questions, or ๐Ÿ—ฃ๏ธ discuss local cloud development:

Contributors

We are thankful to all the people who have contributed to this project.

Backers

We are also grateful to all our backers who have donated to the project. You can become a backer on Open Collective.

Sponsors

You can also support this project by becoming a sponsor on Open Collective. Your logo will show up here along with a link to your website.

License

Copyright (c) 2017-2024 LocalStack maintainers and contributors.

Copyright (c) 2016 Atlassian and others.

This version of LocalStack is released under the Apache License, Version 2.0 (see LICENSE). By downloading and using this software you agree to the End-User License Agreement (EULA).

awscli-local's People

Contributors

4lex1v avatar alexrashed avatar dfangl avatar dominikschubert avatar gromnan avatar harshcasper avatar jeansaad avatar lakkeger avatar ma2yama avatar macnev2013 avatar mjjames avatar monty16597 avatar mpenkov avatar pinzon avatar pzrq avatar viren-nadkarni avatar whummer avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

awscli-local's Issues

awslocal fails with the instance name

The setup.
I've LocalStack in a docker-compose environment, to configure the services I'm using a side cart pattern:

Here's my docker-compose.yml:

version: "3.8"

services:
  localstack:
    container_name: "${LOCALSTACK_DOCKER_NAME-localstack_main}"
    image: localstack/localstack
    ports:
      - "127.0.0.1:4566:4566"            # LocalStack Gateway
      - "127.0.0.1:4510-4559:4510-4559"  # external services port range
      - "127.0.0.1:53:53"                # DNS config (only required for Pro)
      - "127.0.0.1:53:53/udp"            # DNS config (only required for Pro)
      - "127.0.0.1:443:443"              # LocalStack HTTPS Gateway (only required for Pro)
    environment:
      - DEBUG=${DEBUG-}
      - PERSISTENCE=${PERSISTENCE-}
      - LAMBDA_EXECUTOR=${LAMBDA_EXECUTOR-}
      - LOCALSTACK_API_KEY=${LOCALSTACK_API_KEY-}  # only required for Pro
      - DOCKER_HOST=unix:///var/run/docker.sock
    volumes:
      - "${LOCALSTACK_VOLUME_DIR:-./volume}:/var/lib/localstack"
      - "/var/run/docker.sock:/var/run/docker.sock"
  localstack_sidecar:
    image: localstack/localstack
    depends_on:
      - localstack
    entrypoint: >
      awslocal --endpoint-url=http://localstack_main:4566 sqs create-queue --queue-name sample-queue2

The problem is that endpoint-url fails with the "localstack_main" hostname:

check-localstack_sidecar-1  | Invalid endpoint: http://localstack_main:4566

Forcing the container IP and replacing localstack_main with the IP yields the expected result:


check-localstack_sidecar-1  | {
check-localstack_sidecar-1  |     "QueueUrl": "http://192.168.80.2:4566/000000000000/sample-queue2"
check-localstack_sidecar-1  | }
check-localstack_sidecar-1 exited with code 0

P. S. Setting FQDN hostname for the service works too.

Copying a binary file to stdout fails

aws cp supports copying to standard out through aws cp origin -. However, because awslocal attempts to decode the output as UTF-8, this fails for binary files:

> awslocal s3 cp s3://some/bucket/some_file.json.gz -
Exception in thread Thread-1:
Traceback (most recent call last):
  File "/usr/local/Cellar/python/3.7.5/Frameworks/Python.framework/Versions/3.7/lib/python3.7/threading.py", line 926, in _bootstrap_inner
    self.run()
  File "/usr/local/Cellar/python/3.7.5/Frameworks/Python.framework/Versions/3.7/lib/python3.7/threading.py", line 870, in run
    self._target(*self._args, **self._kwargs)
  File "/usr/local/bin/awslocal", line 60, in output_reader
    line = to_str(line)
  File "/usr/local/bin/awslocal", line 51, in to_str
    s = s.decode('utf-8')
UnicodeDecodeError: 'utf-8' codec can't decode byte 0x8b in position 1: invalid start byte

This is easy enough to work around (creating a temporary file and then using cat), but it'd be great to see a fix for this if possible.

Support for EDGE_PORT

It appears that awslocal doesn't support the new edge port (4566). Can support for this be added as it appears the service specific ports are deprecated and will soon disappear? Also, it would be nice if custom edge ports (as per the container EDGE_PORT environment variable) were supported, too.

Cannot install v1

I am trying to run the command form the README

pip3 install awscli-local[ver1] (using python 3, hence pip3)

but get

zsh: no matches found: awscli-local[ver1]

EDIT - I originally has AWS CLI v 2 installed, but used heombrew to install and link AWS CLI v1. But, I stiol cannot install awscli-local[v1]

Can I replace this script with a bash alias ?

The first example in the readme shows that the localaws is a shortcut for aws --endpoint-url=http://localhost:4566. After digging in the code, I found the following bash alias could replace this python script.

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

Is there anything that the python script does, that would fail with this alias ?

Don't get me wrong. I understand this script was necessary when each service was exposed on a distinct port ; and it might be necessary for Windows. I'm trying to minimize my dependencies.

Perhaps, this alternative could be documented ; if it's correct.

All versions of awscli-local now use localstack's single edge service (introduced in v 0.11.0)

The versions in requirements.txt are unlocked, so all versions of awscli-local now try to use the edge service.

Example of problem:
$> pip install awscli-local==0.4
$> docker run -d -p 4566-4583:4566-4583 localstack/localstack:0.10.7
$> awslocal s3 ls
An error occurred (404) when calling the ListBuckets operation: Not Found

Better example, don't run localstack:
$> pip install awscli-local==0.4
$> awslocal s3 ls
Could not connect to the endpoint URL: "http://localhost:4566/"

awscli-local doesn't read a default region from ~/.aws/config

awslocal command doesn't read a default region from ~/.aws/config, but cdklocal does. So an example for LocalStack integration with CDK doesn't seem to work at first glance.

For example, I configure a default region in ~/.aws/config as below.

[default]
region = us-east-2

Then, cdklocal deploy deploys a stack in us-east-2 region.

$ cdklocal bootstrap && cdklocal deploy
...
โœจ  Deployment time: 5.3s

Stack ARN:
arn:aws:cloudformation:us-east-2:000000000000:stack/CdkSampleStack/994c9309

A SNS topic has been created in the stack but awslocal doesn't show it because awslocal investigate us-east-1 region by default.

$ awslocal sns list-topics
{
    "Topics": []
}

If I specify the region with awslocal, the SNS topic is visible.

$ awslocal sns list-topics --region us-east-2
{
    "Topics": [
        {
            "TopicArn": "arn:aws:sns:us-east-2:000000000000:CdkSampleStack-CdkSampleTopic2C761410-c0e07754"
        }
    ]
}

Wouldn't it be more user-friendly if the behavior of awslocal and cdklocal were the same?

Version info

  • AWS CLI: 2.9.11 (Python 3.9.11)
  • awscli-local: 0.20
  • aws-cdk: 2.64.0 (Node.js 18.10.0)
  • aws-cdk-local: 2.16.0

Cannot get a live stream of logs using awslocal logs tail --follow

Im just getting used to using localstack, thanks for the project by the way it's very cool, and this wrapper makes it easier to interact with it.

But just noticed it wasn't possible to get a live stream of logs using the following:
awslocal logs tail --follow /aws/lambda/example_lambda
This only prints out the logs once I stop the command.

As a workaround I found a way to use the aws cli with the following:
aws --endpoint-url=http://localhost:4566 --no-verify-ssl logs tail /aws/lambda/example_lambda --follow
This will print logs out live as I trigger the function to run.

To easily reproduce this, make a lambda
In terminal 1 run
awslocal logs tail --follow /aws/lambda/example_lambda

In terminal 2 run:
awslocal lambda invoke --function-name example_lambda --cli-binary-format raw-in-base64-out --payload '{"key1": "value1"}' outputfile.txt

notice no logs showing, if you cancel the command, it will then show the output.

Not a big deal since there is a workaround, but maybe it would be good if the awslocal cli supported this, cheers.

Trouble running with awscli v1

I have awscli-local installed via pip3 install awscli-local[ver1] and am having issues using the cloudformation package command. It always uses the api as an external process as far as I can tell, because the FORCE_V2 variable is always true? I might be misunderstanding whats going on as im not a python developer.

I tried changing that to False and then got the following error

Traceback (most recent call last):
  File "/usr/local/bin/awslocal", line 272, in <module>
    main()
  File "/usr/local/bin/awslocal", line 98, in main
    run_in_process()
  File "/usr/local/bin/awslocal", line 196, in run_in_process
    if (current_profile['s3'].get('addressing_style') in ['virtual', 'auto']):
TypeError: 'NoneType' object is not subscriptable

Commenting out the offending lines of code allows me to use the tool.

awscli --version
aws-cli/1.20.45 Python/3.9.7 Darwin/20.6.0 botocore/1.21.45

Fork bomb/memory leak with awscli-local==0.15

Your 0.15 release crashes my docker and my buildkit container.

Source: It contains a fork bomb / memory leak

Using the previous version (0.14) fixes the issue.

In my tests, I upload a file to a previously instantiated S3 bucket using the CLI. I do this inside a buildkit container. Check the memory usage and the amount of children spawned after a few seconds using your command:

$ docker stats
๏ฟฝ[2J๏ฟฝ[HCONTAINER ID   NAME                                                                CPU %     MEM USAGE / LIMIT     MEM %     NET I/O          BLOCK I/O         PIDS
b402535797bb   5d1c5ed09c264cf780ae55d08e059f71_localstacklocalstack01216_f4b8e3   0.51%     295.2MiB / 8.748GiB   3.30%     2.9MB / 44.1kB   872MB / 5.76MB    57
252627f19fbb   dag-buildkitd                                                    5.37%     184.7MiB / 8.748GiB   2.06%     0B / 0B          2.35GB / 85.1MB   13
๏ฟฝ[2J๏ฟฝ[HCONTAINER ID   NAME                                                                CPU %     MEM USAGE / LIMIT     MEM %     NET I/O          BLOCK I/O         PIDS
b402535797bb   5d1c5ed09c264cf780ae55d08e059f71_localstacklocalstack01216_f4b8e3   0.51%     295.2MiB / 8.748GiB   3.30%     2.9MB / 44.1kB   872MB / 5.76MB    57
252627f19fbb   dag-buildkitd                                                    5.37%     184.7MiB / 8.748GiB   2.06%     0B / 0B          2.35GB / 85.1MB   13
๏ฟฝ[2J๏ฟฝ[HCONTAINER ID   NAME                                                                CPU %     MEM USAGE / LIMIT     MEM %     NET I/O          BLOCK I/O         PIDS
b402535797bb   5d1c5ed09c264cf780ae55d08e059f71_localstacklocalstack01216_f4b8e3   0.09%     295.2MiB / 8.748GiB   3.30%     2.9MB / 44.1kB   872MB / 5.76MB    57
252627f19fbb   dag-buildkitd                                                    0.00%     184.7MiB / 8.748GiB   2.06%     0B / 0B          2.35GB / 85.1MB   13
๏ฟฝ[2J๏ฟฝ[HCONTAINER ID   NAME                                                                CPU %     MEM USAGE / LIMIT     MEM %     NET I/O          BLOCK I/O         PIDS
b402535797bb   5d1c5ed09c264cf780ae55d08e059f71_localstacklocalstack01216_f4b8e3   0.09%     295.2MiB / 8.748GiB   3.30%     2.9MB / 44.1kB   872MB / 5.76MB    57
252627f19fbb   dag-buildkitd                                                    0.00%     184.7MiB / 8.748GiB   2.06%     0B / 0B          2.35GB / 85.1MB   13
๏ฟฝ[2J๏ฟฝ[HCONTAINER ID   NAME                                                                CPU %     MEM USAGE / LIMIT     MEM %     NET I/O          BLOCK I/O        PIDS
b402535797bb   5d1c5ed09c264cf780ae55d08e059f71_localstacklocalstack01216_f4b8e3   0.06%     295.2MiB / 8.748GiB   3.30%     2.9MB / 44.1kB   872MB / 5.76MB   57
252627f19fbb   dag-buildkitd                                                    65.88%    210.6MiB / 8.748GiB   2.35%     0B / 0B          2.35GB / 87MB    43
๏ฟฝ[2J๏ฟฝ[HCONTAINER ID   NAME                                                                CPU %     MEM USAGE / LIMIT     MEM %     NET I/O          BLOCK I/O        PIDS
b402535797bb   5d1c5ed09c264cf780ae55d08e059f71_localstacklocalstack01216_f4b8e3   0.06%     295.2MiB / 8.748GiB   3.30%     2.9MB / 44.1kB   872MB / 5.76MB   57
252627f19fbb   dag-buildkitd                                                    65.88%    210.6MiB / 8.748GiB   2.35%     0B / 0B          2.35GB / 87MB    43
๏ฟฝ[2J๏ฟฝ[HCONTAINER ID   NAME                                                                CPU %     MEM USAGE / LIMIT     MEM %     NET I/O          BLOCK I/O        PIDS
b402535797bb   5d1c5ed09c264cf780ae55d08e059f71_localstacklocalstack01216_f4b8e3   0.08%     295.2MiB / 8.748GiB   3.30%     2.9MB / 44.1kB   872MB / 5.76MB   57
252627f19fbb   dag-buildkitd                                                    106.31%   310.3MiB / 8.748GiB   3.46%     0B / 0B          2.35GB / 87MB    109
๏ฟฝ[2J๏ฟฝ[HCONTAINER ID   NAME                                                                CPU %     MEM USAGE / LIMIT     MEM %     NET I/O          BLOCK I/O        PIDS
b402535797bb   5d1c5ed09c264cf780ae55d08e059f71_localstacklocalstack01216_f4b8e3   0.08%     295.2MiB / 8.748GiB   3.30%     2.9MB / 44.1kB   872MB / 5.76MB   57
252627f19fbb   dag-buildkitd                                                    106.31%   310.3MiB / 8.748GiB   3.46%     0B / 0B          2.35GB / 87MB    109
๏ฟฝ[2J๏ฟฝ[HCONTAINER ID   NAME                                                                CPU %     MEM USAGE / LIMIT     MEM %     NET I/O          BLOCK I/O        PIDS
b402535797bb   5d1c5ed09c264cf780ae55d08e059f71_localstacklocalstack01216_f4b8e3   0.09%     295.2MiB / 8.748GiB   3.30%     2.9MB / 44.1kB   872MB / 5.76MB   57
252627f19fbb   dag-buildkitd                                                    103.28%   427.3MiB / 8.748GiB   4.77%     0B / 0B          2.35GB / 87MB    184
๏ฟฝ[2J๏ฟฝ[HCONTAINER ID   NAME                                                                CPU %     MEM USAGE / LIMIT     MEM %     NET I/O          BLOCK I/O        PIDS
b402535797bb   5d1c5ed09c264cf780ae55d08e059f71_localstacklocalstack01216_f4b8e3   0.09%     295.2MiB / 8.748GiB   3.30%     2.9MB / 44.1kB   872MB / 5.76MB   57
252627f19fbb   dag-buildkitd                                                    103.28%   427.3MiB / 8.748GiB   4.77%     0B / 0B          2.35GB / 87MB    184
...
๏ฟฝ[2J๏ฟฝ[HCONTAINER ID   NAME                                                                CPU %     MEM USAGE / LIMIT     MEM %     NET I/O          BLOCK I/O        PIDS
b402535797bb   5d1c5ed09c264cf780ae55d08e059f71_localstacklocalstack01216_f4b8e3   0.06%     295.2MiB / 8.748GiB   3.30%     2.9MB / 44.1kB   872MB / 5.76MB   57
252627f19fbb   dag-buildkitd                                                    103.97%   2.612GiB / 8.748GiB   29.86%    0B / 0B          2.35GB / 87MB    1609
๏ฟฝ[2J๏ฟฝ[HCONTAINER ID   NAME                                                                CPU %     MEM USAGE / LIMIT     MEM %     NET I/O          BLOCK I/O        PIDS
b402535797bb   5d1c5ed09c264cf780ae55d08e059f71_localstacklocalstack01216_f4b8e3   0.06%     295.2MiB / 8.748GiB   3.30%     2.9MB / 44.1kB   872MB / 5.76MB   57
252627f19fbb   dag-buildkitd                                                    103.26%   2.723GiB / 8.748GiB   31.13%    0B / 0B          2.35GB / 87MB    1678
๏ฟฝ[2J๏ฟฝ[HCONTAINER ID   NAME                                                                CPU %     MEM USAGE / LIMIT     MEM %     NET I/O          BLOCK I/O        PIDS
b402535797bb   5d1c5ed09c264cf780ae55d08e059f71_localstacklocalstack01216_f4b8e3   0.06%     295.2MiB / 8.748GiB   3.30%     2.9MB / 44.1kB   872MB / 5.76MB   57
252627f19fbb   dag-buildkitd                                                    103.26%   2.723GiB / 8.748GiB   31.13%    0B / 0B          2.35GB / 87MB    1678
๏ฟฝ[2J๏ฟฝ[HCONTAINER ID   NAME                                                                CPU %     MEM USAGE / LIMIT     MEM %     NET I/O          BLOCK I/O        PIDS
b402535797bb   5d1c5ed09c264cf780ae55d08e059f71_localstacklocalstack01216_f4b8e3   0.07%     295.2MiB / 8.748GiB   3.30%     2.9MB / 44.1kB   872MB / 5.76MB   57
252627f19fbb   dag-buildkitd                                                    103.06%   2.82GiB / 8.748GiB    32.24%    0B / 0B          2.35GB / 87MB    1738
๏ฟฝ[2J๏ฟฝ[HCONTAINER ID   NAME                                                                CPU %     MEM USAGE / LIMIT     MEM %     NET I/O          BLOCK I/O        PIDS
b402535797bb   5d1c5ed09c264cf780ae55d08e059f71_localstacklocalstack01216_f4b8e3   0.07%     295.2MiB / 8.748GiB   3.30%     2.9MB / 44.1kB   872MB / 5.76MB   57
252627f19fbb   dag-buildkitd                                                    103.06%   2.82GiB / 8.748GiB    32.24%    0B / 0B          2.35GB / 87MB    1738
๏ฟฝ[2J๏ฟฝ[HCONTAINER ID   NAME                                                                CPU %     MEM USAGE / LIMIT     MEM %     NET I/O          BLOCK I/O        PIDS
b402535797bb   5d1c5ed09c264cf780ae55d08e059f71_localstacklocalstack01216_f4b8e3   0.07%     295.2MiB / 8.748GiB   3.30%     2.9MB / 44.1kB   872MB / 5.76MB   57
252627f19fbb   dag-buildkitd                                                    103.57%   2.929GiB / 8.748GiB   33.48%    0B / 0B          2.35GB / 87MB    1807
๏ฟฝ[2J๏ฟฝ[HCONTAINER ID   NAME                                                                CPU %     MEM USAGE / LIMIT     MEM %     NET I/O          BLOCK I/O        PIDS
b402535797bb   5d1c5ed09c264cf780ae55d08e059f71_localstacklocalstack01216_f4b8e3   0.07%     295.2MiB / 8.748GiB   3.30%     2.9MB / 44.1kB   872MB / 5.76MB   57
252627f19fbb   dag-buildkitd                                                    103.57%   2.929GiB / 8.748GiB   33.48%    0B / 0B          2.35GB / 87MB    1807
๏ฟฝ[2J๏ฟฝ[HCONTAINER ID   NAME                                                                CPU %     MEM USAGE / LIMIT     MEM %     NET I/O          BLOCK I/O        PIDS
b402535797bb   5d1c5ed09c264cf780ae55d08e059f71_localstacklocalstack01216_f4b8e3   0.07%     295.2MiB / 8.748GiB   3.30%     2.9MB / 44.1kB   872MB / 5.76MB   57
252627f19fbb   dag-buildkitd                                                    103.29%   3.039GiB / 8.748GiB   34.74%    0B / 0B          2.35GB / 87MB    1876

We go from 13 PIDs, to 1876 in a matter of 30 seconds, same for the disk usage (180mb to 3gb). ECR also has the issue (upload of an image to a previously created registry), I believe this is due to a global leak on the command

bug: cannot install for python 3.7.4

Specs

OS: ManjaroLinux
Version: 21.2.6
PythonVersion: 3.7.4
PipVersion: 22.1

Description

I tried installing the awscli-local package using pip, but I get the following output:

Collecting awscli-local[ver1]
  Using cached awscli-local-0.20.tar.gz (6.9 kB)
  Preparing metadata (setup.py) ... error
  error: subprocess-exited-with-error
  
  ร— python setup.py egg_info did not run successfully.
  โ”‚ exit code: 1
  โ•ฐโ”€> [28 lines of output]
      running egg_info
      creating /tmp/pip-pip-egg-info-gl3b465n/awscli_local.egg-info
      writing /tmp/pip-pip-egg-info-gl3b465n/awscli_local.egg-info/PKG-INFO
      writing dependency_links to /tmp/pip-pip-egg-info-gl3b465n/awscli_local.egg-info/dependency_links.txt
      writing requirements to /tmp/pip-pip-egg-info-gl3b465n/awscli_local.egg-info/requires.txt
      writing top-level names to /tmp/pip-pip-egg-info-gl3b465n/awscli_local.egg-info/top_level.txt
      Traceback (most recent call last):
        File "<string>", line 36, in <module>
        File "<pip-setuptools-caller>", line 34, in <module>
        File "/tmp/pip-install-8v6hjaq1/awscli-local_2e45f7fad4a54eb7bc89219706a3cc40/setup.py", line 46, in <module>
          "Topic :: Software Development :: Testing"
        File "/home/phii/Code/aws-test/.venv/lib/python3.7/site-packages/setuptools/__init__.py", line 87, in setup
          return distutils.core.setup(**attrs)
        File "/home/phii/Code/aws-test/.venv/lib/python3.7/site-packages/setuptools/_distutils/core.py", line 148, in setup
          return run_commands(dist)
        File "/home/phii/Code/aws-test/.venv/lib/python3.7/site-packages/setuptools/_distutils/core.py", line 163, in run_commands
          dist.run_commands()
        File "/home/phii/Code/aws-test/.venv/lib/python3.7/site-packages/setuptools/_distutils/dist.py", line 967, in run_commands
          self.run_command(cmd)
        File "/home/phii/Code/aws-test/.venv/lib/python3.7/site-packages/setuptools/dist.py", line 1229, in run_command
          super().run_command(command)
        File "/home/phii/Code/aws-test/.venv/lib/python3.7/site-packages/setuptools/_distutils/dist.py", line 986, in run_command
          cmd_obj.run()
        File "/home/phii/Code/aws-test/.venv/lib/python3.7/site-packages/setuptools/command/egg_info.py", line 300, in run
          writer = ep.load()
        File "/home/phii/Code/aws-test/.venv/lib/python3.7/site-packages/setuptools/_vendor/importlib_metadata/__init__.py", line 196, in load
          return functools.reduce(getattr, attrs, module)
      AttributeError: module 'plugin.setuptools' has no attribute 'load_plux_entrypoints'
      [end of output]
  
  note: This error originates from a subprocess, and is likely not a problem with pip.
error: metadata-generation-failed

ร— Encountered error while generating package metadata.
โ•ฐโ”€> See above for output.

note: This is an issue with the package mentioned above, not pip.
hint: See above for details.

awslocal cli-read-timeout doesn't work as expected

Trying to add read-timeout to my awslocal command but it doesn't help:
awslocal sqs list-queues --cli-read-timeout 5
connect timeout doesn't work as well:
awslocal sqs list-queues --cli-connect-timeout 5

OS: Windows 10
awslocal --v: aws-cli/1.18.39 Python/2.7.17 Windows/10 botocore/1.15.39

awslocal sqs list-queues doesn't work

Listing SQS queues doesn't work with awslocal but it does work with plain aws pointing it to the right port.

$ AWS_ACCESS_KEY_ID=foo AWS_SECRET_ACCESS_KEY=bar AWS_DEFAULT_REGION=eu-west-3 aws --endpoint-url=http://localhost:4566 sqs list-queues
{
    "QueueUrls": [
        "http://localhost:4566/000000000000/queue1-dead-letter",
        "http://localhost:4566/000000000000/queue2-dead-letter",
        "http://localhost:4566/000000000000/queue2",
        "http://localhost:4566/000000000000/queue1"
    ]
}
$ awslocal sqs list-queues
$

Cannot install awscli-local with ebcli v3

Hi everyone !

I tried to install awscli-local with ebcli v3 but :

  • awslocal requires six, which requires botocore >= 1.20.0
  • latest ebcli (3.19.3) requires botocore < 1.20

Any idea on how I can fix that ?

Error message when installing via `pip`

Hey, something is going on when installing awscli-local via pip:

docker run -ti --entrypoint bash python

root@dbb55d128863:/# pip install awscli-local
Collecting awscli-local
  Downloading awscli-local-0.12.tar.gz (5.0 kB)
Collecting localstack-client
  Downloading localstack-client-1.10.tar.gz (4.3 kB)
Collecting boto3
  Downloading boto3-1.16.40-py2.py3-none-any.whl (130 kB)
     |โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ| 130 kB 1.8 MB/s
Collecting botocore<1.20.0,>=1.19.40
  Downloading botocore-1.19.40-py2.py3-none-any.whl (7.1 MB)
     |โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ| 7.1 MB 15.5 MB/s
Collecting jmespath<1.0.0,>=0.7.1
  Downloading jmespath-0.10.0-py2.py3-none-any.whl (24 kB)
Collecting python-dateutil<3.0.0,>=2.1
  Downloading python_dateutil-2.8.1-py2.py3-none-any.whl (227 kB)
     |โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ| 227 kB 11.9 MB/s
Collecting s3transfer<0.4.0,>=0.3.0
  Downloading s3transfer-0.3.3-py2.py3-none-any.whl (69 kB)
     |โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ| 69 kB 8.5 MB/s
Collecting six>=1.5
  Downloading six-1.15.0-py2.py3-none-any.whl (10 kB)
Collecting urllib3<1.27,>=1.25.4
  Downloading urllib3-1.26.2-py2.py3-none-any.whl (136 kB)
     |โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ| 136 kB 27.7 MB/s
Building wheels for collected packages: awscli-local, localstack-client
  Building wheel for awscli-local (setup.py) ... done
  Created wheel for awscli-local: filename=awscli_local-0.12-py3-none-any.whl size=4529 sha256=5f0fb63be73b03ae5b4ca544438f7bc294c1d1ccc958eaefe6839a395728a665
  Stored in directory: /root/.cache/pip/wheels/ce/35/2f/26fb372ab125cb51548b95876ac844fda1c311455770e9b73c
  Building wheel for localstack-client (setup.py) ... done
  Created wheel for localstack-client: filename=localstack_client-1.10-py3-none-any.whl size=3809 sha256=8f76b99d892cc75c5cf02a97b61e3000011a4ded27392b71a88bc2b457c4998e
  Stored in directory: /root/.cache/pip/wheels/5e/ed/92/4f85adb3f58631a730c35d08bdad0fe7a6d0c48b8456e522f8
Successfully built awscli-local localstack-client
ERROR: Error while checking for conflicts. Please file an issue on pip's issue tracker: https://github.com/pypa/pip/issues/new
Traceback (most recent call last):
  File "/usr/local/lib/python3.9/site-packages/pip/_vendor/pkg_resources/__init__.py", line 3021, in _dep_map
    return self.__dep_map
  File "/usr/local/lib/python3.9/site-packages/pip/_vendor/pkg_resources/__init__.py", line 2815, in __getattr__
    raise AttributeError(attr)
AttributeError: _DistInfoDistribution__dep_map

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.9/site-packages/pip/_internal/commands/install.py", line 517, in _determine_conflicts
    return check_install_conflicts(to_install)
  File "/usr/local/lib/python3.9/site-packages/pip/_internal/operations/check.py", line 107, in check_install_conflicts
    would_be_installed = _simulate_installation_of(to_install, package_set)
  File "/usr/local/lib/python3.9/site-packages/pip/_internal/operations/check.py", line 135, in _simulate_installation_of
    package_set[name] = PackageDetails(dist.version, dist.requires())
  File "/usr/local/lib/python3.9/site-packages/pip/_vendor/pkg_resources/__init__.py", line 2736, in requires
    dm = self._dep_map
  File "/usr/local/lib/python3.9/site-packages/pip/_vendor/pkg_resources/__init__.py", line 3023, in _dep_map
    self.__dep_map = self._compute_dependencies()
  File "/usr/local/lib/python3.9/site-packages/pip/_vendor/pkg_resources/__init__.py", line 3040, in _compute_dependencies
    common = frozenset(reqs_for_extra(None))
  File "/usr/local/lib/python3.9/site-packages/pip/_vendor/pkg_resources/__init__.py", line 3037, in reqs_for_extra
    if not req.marker or req.marker.evaluate({'extra': extra}):
  File "/usr/local/lib/python3.9/site-packages/pip/_vendor/packaging/markers.py", line 328, in evaluate
    return _evaluate_markers(self._markers, current_environment)
  File "/usr/local/lib/python3.9/site-packages/pip/_vendor/packaging/markers.py", line 250, in _evaluate_markers
    groups[-1].append(_eval_op(lhs_value, op, rhs_value))
  File "/usr/local/lib/python3.9/site-packages/pip/_vendor/packaging/markers.py", line 201, in _eval_op
    return spec.contains(lhs)
  File "/usr/local/lib/python3.9/site-packages/pip/_vendor/packaging/specifiers.py", line 206, in contains
    normalized_item = self._coerce_version(item)
  File "/usr/local/lib/python3.9/site-packages/pip/_vendor/packaging/specifiers.py", line 170, in _coerce_version
    version = parse(version)
  File "/usr/local/lib/python3.9/site-packages/pip/_vendor/packaging/version.py", line 57, in parse
    return Version(version)
  File "/usr/local/lib/python3.9/site-packages/pip/_vendor/packaging/version.py", line 296, in __init__
    match = self._regex.search(version)
TypeError: expected string or bytes-like object
Installing collected packages: six, urllib3, python-dateutil, jmespath, botocore, s3transfer, boto3, localstack-client, awscli-local
Successfully installed awscli-local-0.12 boto3-1.16.40 botocore-1.19.40 jmespath-0.10.0 localstack-client-1.10 python-dateutil-2.8.1 s3transfer-0.3.3 six-1.15.0 urllib3-1.26.2

port mapping

in docker compose we remapped localstack ports to other port, and because of this awslocal cannot connect to the services properly. Is there anyway we can also remap awscli ports? thanks!

missing awscli

In a fresh virtual environment, I did

$ pip install awscli-local
$ awslocal

which produced the following error: ModuleNotFoundError: No module named 'awscli'

This was fixable by just doing

$ pip install awscli
$ awslocal --version
aws-cli/1.19.39 Python/3.9.2 Windows/10 botocore/1.20.39

shouldn't we tell pip the dependency when installing awslocal in the first place?

NOTE
I did try on different versions of pip since the changelog mentioned new args for new pip versions

$ pip --version
pip 20.2.3 
$ pip --version
pip 21.0.1 

Bug during cloudformation deploy -- Unknown options: --s3-endpoint-url

Observed Behavior

$> awslocal cloudformation deploy --template-file template.yml --stack-name throwaway

Unknown options: --s3-endpoint-url=http://localhost:4566

Exit code 252

Expected Behavior

$> awslocal cloudformation deploy --template-file template.yml --stack-name throwaway

(command succeeds with exit code 0)

Details

$> pip3 show awscli-local
Name: awscli-local
Version: 0.13
Summary: Thin wrapper around the "aws" command line interface for use with LocalStack
Home-page: https://github.com/localstack/awscli-local
Author: Waldemar Hummer
Author-email: [email protected]
License: Apache License 2.0
Location: /home/carlschroedl/.local/lib/python3.6/site-packages
Requires: localstack-client
$> aws --version
aws-cli/2.1.17 Python/3.7.3 Linux/5.4.0-58-generic exe/x86_64.ubuntu.18 prompt/off
$> localstack --version
/usr/share/python-wheels/requests-2.18.4-py2.py3-none-any.whl/requests/__init__.py:80: RequestsDependencyWarning: urllib3 (1.26.3) or chardet (3.0.4) doesn't match a supported version!
0.12.6.1

I also tried specifying my own value for --s3-endpoint-url. This failed with different output.

$> awslocal cloudformation deploy --s3-endpoint-url http://localhost:4566 --template-file template.yml --stack-name throwaway

Unknown options: --s3-endpoint-url=http://localhost:4566,--s3-endpoint-url,http://localhost:4566

Exit code 252

s3api not automatic wrap localstack endpoint

If you are using awslocal s3api to create bucket its not wrapping the endpoint for LocalStack you need to add the endpoint self.

awslocal s3api create-bucket \
    --bucket {bucket-name} \
    --endpoint-url=http://localhost:4566

Shoud be a option to do, whitout defineding the endpoint.

awslocal s3api create-bucket \
    --bucket {bucket-name}

need a one liner to setup aws cli for localstack

Hi - we are setting up localstack in our CircleCI CI/CD env for auto testing...and its been a big pain...
now we need to install python (didnt before) to just install aws cli (didn't before) to just be able to setup a default SQS queue......(vs env var or http post to do it)

our unit test build now taking a long time, and we can't seem to actually get aws cli to just setup via aws configure in one line with NO prompting interactively (we set all aws env vars ahead of time...)

please help (realize it not specifically the job of this wrapper, but not sure where else to post...)

awslocal vs aws

The awscli-local is not compatible with the aws cli from AWS.
If I create a kinesis stream with

aws --endpoint-url=http://localhost:4566 kinesis create-stream \
    --stream-name ride_predictions \
    --shard-count 1

I can't view the streams using

awslocal kinesis list-streams

I can only view the streams using

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

And vice-versa.

Since in both cases it is using localstack, they should give the same result (which is not the case!)

Error when running awslocal

aws-cli/2.1.35 Python/3.8.8 Windows/10 exe/AMD64 prompt/off

Fatal Python error: _Py_HashRandomization_Init: failed to get random numbers to initialize Python
Python runtime state: preinitialized

Specifying `--endpoint-url` gets an "Unable to find LocalStack endpoint for service" error

I was running a seperate testing Localstack host that exposes different ports with the docker-compose file like this:

version: "3.8"

services:
  localstack-testing:
    container_name: "${LOCALSTACK_DOCKER_NAME-localstack_testing}"
    image: localstack/localstack
    ports:
      - "127.0.0.1:5510-5559:4510-4559"  # <--Port number changed here
      - "127.0.0.1:5566:4566"            # <--Port number changed here
    environment:
      - LOCALSTACK_SERVICES=${SERVICES-}
      - DEBUG=${DEBUG-}
      - DATA_DIR=${DATA_DIR-}
      - LAMBDA_EXECUTOR=${LAMBDA_EXECUTOR-}
      - HOST_TMP_FOLDER=${TMPDIR:-/tmp/}localstack
      - DOCKER_HOST=unix:///var/run/docker.sock
    volumes:
      - "${TMPDIR:-/tmp}/localstack:/tmp/localstack"
      - "/var/run/docker.sock:/var/run/docker.sock"

The Localstack service was started by docker-compose up command and went up normally.

When I tried the awslocal --endpoint-url http://localhost:5566/ help command, an error occured:
ERROR: Unable to find LocalStack endpoint for service "http://localhost:5566/"

However, when using aws instead of awslocal, the command was successfully executed and the help message was shown.

If any extra information is needed to reproduce the situation, please let me know.

Windows 7 problem

Hello,

I have a problem to use it on Windows 7.
I run installation command (pip install awscli-local) without any errors.

But if I want to use it, see what I get:

C:>awslocal --version
'awslocal' is not recognized as an internal or external command, operable program or batch file.

what should be wrong ?

thanks

[bug]: Can't add url config for lambda in local stack using aws-sdk

Hi! first off thanks for a useful library for emulating AWS resources locally.

The issue I'm encountering is using the nodejs aws-sdk to create resources in localstack.

If I create a lambda, and then try to create/list/get a URL config for the lambda I get the following error which provides nothing to go off of for investigation:

Error [UnknownError]
    at Object.extractError (/Users/aspence/src/canvas/node_modules/aws-sdk/lib/protocol/json.js:52:27)
    at Request.extractError (/Users/aspence/src/canvas/node_modules/aws-sdk/lib/protocol/rest_json.js:61:8)
    at Request.callListeners (/Users/aspence/src/canvas/node_modules/aws-sdk/lib/sequential_executor.js:106:20)
    at Request.emit (/Users/aspence/src/canvas/node_modules/aws-sdk/lib/sequential_executor.js:78:10)
    at Request.emit (/Users/aspence/src/canvas/node_modules/aws-sdk/lib/request.js:686:14)
    at Request.transition (/Users/aspence/src/canvas/node_modules/aws-sdk/lib/request.js:22:10)
    at AcceptorStateMachine.runTo (/Users/aspence/src/canvas/node_modules/aws-sdk/lib/state_machine.js:14:12)
    at /Users/aspence/src/canvas/node_modules/aws-sdk/lib/state_machine.js:26:10
    at Request.<anonymous> (/Users/aspence/src/canvas/node_modules/aws-sdk/lib/request.js:38:9)
    at Request.<anonymous> (/Users/aspence/src/canvas/node_modules/aws-sdk/lib/request.js:688:12)
    at Request.callListeners (/Users/aspence/src/canvas/node_modules/aws-sdk/lib/sequential_executor.js:116:18)
    at Request.emit (/Users/aspence/src/canvas/node_modules/aws-sdk/lib/sequential_executor.js:78:10)
    at Request.emit (/Users/aspence/src/canvas/node_modules/aws-sdk/lib/request.js:686:14)
    at Request.transition (/Users/aspence/src/canvas/node_modules/aws-sdk/lib/request.js:22:10)
    at AcceptorStateMachine.runTo (/Users/aspence/src/canvas/node_modules/aws-sdk/lib/state_machine.js:14:12)
    at /Users/aspence/src/canvas/node_modules/aws-sdk/lib/state_machine.js:26:10 {
  code: 'UnknownError',
  statusCode: 404,
  time: 2022-12-22T01:19:24.624Z,
  requestId: undefined,
  retryable: false,
  retryDelay: 48.11161846934877
}
create-resources started 907

See an reproducible example below, assuming 'test-lambda' has already been created:

import { Lambda } from 'aws-sdk';

import { buildWorker, packageWorker } from './workers';

const lambda = new Lambda({
  region: 'us-east-1',
  endpoint: 'http://localhost:4566',
});

const name = 'test-lambda';

it('Test create resources', async () => {
  lambda.addPermission({
    FunctionName: name,
    Action: 'lambda:InvokeFunctionUrl',
    Principal: '*',
    FunctionUrlAuthType: 'NONE',
    StatementId: '/',
  });

  try {
    // THIS FAILS
    // So does the list, or get commands
    const result = await lambda
      .createFunctionUrlConfig({
        FunctionName: name,
        AuthType: 'NONE',
      })
      .promise();
    console.log('result: ', result);
  } catch (e) {
    console.error(e);
  }
});

setup.py change breaks installation on python 2.7

My team uses awscli-local in some automated tests, and version 0.19 failed to install where 0.18 succeeded. The error we get is:

Downloading https://files.pythonhosted.org/packages/72/fe/c34701b02a6c5af1a89c6d14a02802f06b27a646a09380b2ecd957187cfc/awscli-local-0.19.tar.gz
    Complete output from command python setup.py egg_info:
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/tmp/pip-build-sV1Llb/awscli-local/setup.py", line 5, in <module>
        with open('README.md', encoding='utf8') as f:
    TypeError: 'encoding' is an invalid keyword argument for this function

I'll admit I'm not a python expert, but I believe I've tracked it down to this change in setup.py:

https://github.com/localstack/awscli-local/compare/254273bce710eb69f50dcefe09e168f3d61bda60..master#diff-60f61ab7a8d1910d86d9fda2261620314edcae5894d5aaa236b821c7256badd7R5

with open('README.md', encoding='utf8') as f:

It looks like encoding is not accepted by open() on python 2.7: https://docs.python.org/2/library/functions.html#open

We have worked around the issue by pinning to version 0.18, but I wonder if our use-case is something that you are willing and able to support.

Error when using 'awslocal configure list'

Environment:

  • awscli-local: 0.20 (from awscli_local-0.20-py3-none-any.whl)
  • localstack: 1.2.0
  • aws-cli/2.8.12 Python/3.10.8 Darwin/22.1.0 source/x86_64 prompt/off

When I used awslocal configure list, I got ERROR: Unable to find LocalStack endpoint for service "configure".
It should be used to verify the current configuration as the document said.

awslocal with LOCALSTACK_HOST - Invalid endpoint

I'm trying to invoke stuff in my localstack container (named localstack_main) from another localstack container (docker run --rm -it --network=container:localstack_main --entrypoint="" -e LOCALSTACK_HOST=localstack_main localstack/localstack awslocal sns create-topic --name test - or --network=network-name), but this results in:

Invalid endpoint: http://localstack_main:4566

But the port is reachable from within the auxilliary container:

root@fc8d9a10f8c9:/opt/code/localstack# nmap -p4000-5000 localstack_main
Starting Nmap 7.70 ( https://nmap.org ) at 2022-11-28 11:08 UTC
Nmap scan report for localstack_main (172.27.0.3)
Host is up (0.0000040s latency).
rDNS record for 172.27.0.3: fc8d9a10f8c9
Not shown: 938 closed ports, 62 filtered ports
PORT     STATE SERVICE
4566/tcp open  kwtc

And awslocal sns create-topic --name test works fine from within the localstack_main container.

Am I missing something?

bash: awslocal : command not found

Hey, guys,
after installation, the awslocal command is not recognized. What should be done?

pip 18.1 from /usr/lib/python2.7/dist-packages/pip (python 2.7)

Remove awscli from dependencies

Starting with AWS CLI v2, the tool is no longer distributed as a pip package but instead a standalone tool with all dependencies included.

Due to awscli-local making the awscli a requirement, the v2 CLI gets overwritten by the v1 CLI (as they both get installed to /usr/local/bin/aws).

It would be better to have developers manually install the version of the AWS CLI they would like to use instead of awscli-local trying to install it for them.

Readme

The link for Localstack points to the dead repository. Would be nice if it pointed to currently maintained fork.

Testing issue when trying to add to conda-forge

I'm attempting to add this to conda-forge and in the recipe have the command awslocal -h to simply check for functionality, which runs fine on linux & mac osx but when testing in azure on windows I get "awslocal is not recognized as an internal or external command"
Is there a different command I can use to test that installation was successful?

Unable to deploy with cloudformation

I am trying to deploy a SAM template using cloudformation, the packaging seems to work fine, however when I try to deploy it just returns 'Parameters'

this is the script I am using:


awslocal s3 mb s3://${BUCKET}

awslocal \
  --s3-endpoint-url=http://localhost:4566 \
    cloudformation package \
    --template-file template-local.yaml \
    --output-template-file output.yaml \
    --s3-bucket "${BUCKET}"

awslocal cloudformation deploy \
  --template-file output.yaml \
  --stack-name "${PROJECT}" \
  --capabilities CAPABILITY_IAM \
  --parameter-overrides \
  Environment="${ENV}" \
  Appname="${APPNAME}"

Docker-compose:

version: "3"
services:
  localstack:
    image: localstack/localstack
    container_name: localstack
    environment:
      - DATA_DIR=/tmp/localstack/data
      - SERVICES=s3,lambda,apigateway,cloudformation,iam
      - LAMBDA_EXECUTOR=docker-reuse
    ports:
      - '4572:4572'
      - '4566:4566'

this is the output of the script:

make_bucket: connections-test-dev-lambda-deployment-artifacts
Uploading to 9b170e29aed89b91edbf6e8c18ef4aa6  9151213 / 9151213.0  (100.00%)
Successfully packaged artifacts and wrote output template to file output.yaml.
Execute the following command to deploy the packaged template
aws cloudformation deploy --template-file /Users/path/to/template/output.yaml --stack-name <YOUR STACK NAME>

'Parameters'

The same script works fine if I deploy on AWS

I have also tried this:


aws --endpoint-url=http://localhost:4566 --profile ${PROFILE} --region ${REGION} cloudformation deploy \
  --template-file output.yaml \
  --stack-name "${PROJECT}" \
  --capabilities CAPABILITY_IAM \
  --parameter-overrides \
  Environment="${ENV}" \
  Appname="${APPNAME}"

But I get the exact same output

Versions:

localstack: 0.12.2
awslocal: aws-cli/1.18.181 Python/3.9.0 Darwin/19.6.0 botocore/1.19.21

Any help is appreciated. Thanks.

Some more informations:

Localstack start-up output logs:


Waiting for all LocalStack services to be ready
2020-11-19 01:38:20,012 CRIT Supervisor is running as root.  Privileges were not dropped because no user is specified in the config file.  If you intend to run as root, you can set user=root in the config file to avoid this message.
2020-11-19 01:38:20,018 INFO supervisord started with pid 13
2020-11-19 01:38:21,027 INFO spawned: 'dashboard' with pid 19
2020-11-19 01:38:21,039 INFO spawned: 'infra' with pid 20
2020-11-19 01:38:21,060 INFO success: dashboard entered RUNNING state, process has stayed up for > than 0 seconds (startsecs)
2020-11-19 01:38:21,066 INFO exited: dashboard (exit status 0; expected)
(. .venv/bin/activate; exec bin/localstack start --host)
Starting local dev environment. CTRL-C to quit.
LocalStack version: 0.12.2
2020-11-19 01:38:22,867 INFO success: infra entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
Waiting for all LocalStack services to be ready
Starting edge router (https port 4566)...
Starting mock API Gateway service on http port 4566 ...
[2020-11-19 01:38:32 +0000] [21] [INFO] Running on https://0.0.0.0:4566 (CTRL + C to quit)
2020-11-19T01:38:32:INFO:hypercorn.error: Running on https://0.0.0.0:4566 (CTRL + C to quit)
[2020-11-19 01:38:32 +0000] [21] [INFO] Running on http://0.0.0.0:39947 (CTRL + C to quit)
2020-11-19T01:38:32:INFO:hypercorn.error: Running on http://0.0.0.0:39947 (CTRL + C to quit)
Waiting for all LocalStack services to be ready
Starting mock CloudFormation service on http port 4566 ...
Starting mock CloudWatch service on http port 4566 ...
Starting mock IAM service on http port 4566 ...
Starting mock Lambda service on http port 4566 ...
Starting mock CloudWatch Logs service on http port 4566 ...
ERROR: 'docker ps -a --filter="name=localstack_lambda_*" --format "{{.Names}}"': exit code 1; output: b''
Starting mock S3 service on http port 4566 ...
Waiting for all LocalStack services to be ready
Waiting for all LocalStack services to be ready
Ready.


awslocal s3api on windows 10

Trying to provide public read to the bucket: bucket "tutorial" created.
running the following command -
awslocal s3api put-bucket-acl --bucket tutorial --acl public-read
returns -

usage: aws [options] [ ...] [parameters]
To see help text, you can run:

aws help
aws help
aws help
aws: error: the following arguments are required: --bucket*

--bucket is provided in the command.

Deploying OpenSearch doesn't create `/_dashboards/`?

Howdy!

I followed along with the tutorial over here to deploy an instance of OpenSearch locally.

When I got my domain setup, I was able to access the endpoint, http://[my-domain-name].us-east-1.opensearch.localhost.localstack.cloud:4566, just fine; when I tried appending /_dashboards/ to it, however, I got this message.

image

I was able to put data into it and get data out via curl, but there just doesn't seem to be any Dashboard available.

Could this be a Docker issue, or could it be that dashboards aren't available through LocalStack for some reason? Maybe it's a Python-related issue, somehow?

Thank you!

Trying to use the old ports

I posted this in the LocalStack issues as well, but realized it may be an awscli-local issue. Once I changed my docker setup to use LocalStack 0.12.7 my awslocal command is still trying to connect using the old (and deprecated) port numbers. Here's my docker service:

  localstack:
    image: localstack/localstack:0.12.7
    restart: always
    ports:
      - 4566:4566
      - 8080:8080
    environment:
      - DOCKER_HOST=unix.///var/run/docker.sock
      - DEFAULT_REGION=us-east-1
      - DEBUG=1
      - PORT_WEB_UI=8080
      - DATA_DIR=/tmp/localstack/data
    volumes:
      - ${LOG_ROOT}/localstack/:/tmp/localstack
      - /var/run/docker.sock:/var/run/docker.sock
      - ./localstack/startup/:/docker-entrypoint-initaws.d
    networks:
      - myNetwork

Using this, I get Could not connect to the endpoint URL: "http://localhost:4576/". If I change my ports to "4566-4599:4566-4599" I get Connection was closed before we received a valid response from endpoint URL: "http://localhost:4576/". What's the secret to using port 4566?

[Deleted]

[Deleted: asked in wrong place. Apologies, mods!]

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.