Add command line tool and lightweight clients to localstack

Issue #27 resolved
Jeff Wu created an issue

I'd like to make a proposal to create lightweight client libraries for specific languages. The idea would be that a developer could easily install and run localstack by executing a set of docker commands (or install a simple command line tool to do so) without installing all the dependencies of localstack. This CLI might work like:

brew install localstack

localstack start --services='sqs,kinesis' 
# this would run:
docker run ....

localstack stop
# etc.

Then within the testing dependencies of their application they could include a simple client that overwrites the AWS SDK methods in that language to return the localstack endpoints. This way developers can use localstack while minimally changing their code (so they don't have to use localstack methods).

Unsure how we could include these clients into the repo so they are installable in different languages. For example:

pip install localstack-client

npm install localstack-client

go get bitbucket.org/localstack/go-client

etc.

Comments (5)

  1. Waldemar Hummer Account Deactivated

    Thanks @jeffreyyungwu , those are great suggestions. Let me just add a few thoughts.

    1. A localstack CLI tool to start the services would definitely be useful. I'm not sure whether brew is the best framework to distribute the CLI, though. Maybe we could simply extend the existing CLI that can be installed via pip install localstack (which is cross-platform compatible)? (Note that the pip package installs relatively fast, only if you run make infra for the first time it actually lazy loads / downloads the infrastructure dependencies, i.e., JARs for Elasticsearch, DynamoDB etc.)

    2. Regarding the clients for different languages, I guess we could maintain the majority of these libraries in the main repo (e.g., in folders ext/client/python, ext/client/nodejs etc, and building/publishing the libs via our CI on Bitbucket Pipelines), but for some of the libs we may have to create separate repositories (for example for the go get example above).

    Btw, for Java/Spring there is already a pretty nice third-party project here: https://github.com/smartupio/localstack-spring-boot (although the scope of that project is probably beyond the simple, light-weight client layer that you are proposing here).

    How can we kick this off - would you be able to start contributing some of these CLIs/libs? Cheers

  2. Jeff Wu reporter

    Yeah we can break this up into two parts. I'll take a look at extending the existing CLI first, maybe in the next week or so and try to raise a PR there.

    We can split out the clients for separate libraries. I have one for Python that I'm using right now that I can commit in a PR this week as well.

  3. Jeff Wu reporter

    I raised a PR for the python client, let me know your initial thoughts. I think I'm going to give up on the CLI because I discovered that docker-compose works really well for this already.

  4. Waldemar Hummer Account Deactivated

    Thanks for the PR, I've added a few comments there. Closing this issue for now, we can come back to it when/if we plan to implement the extended CLI.

  5. Log in to comment