Skip to content
This repository has been archived by the owner on May 1, 2023. It is now read-only.

⚠️ **Note**: This repository is no longer actively maintained (see README below) ⚠️

License

Notifications You must be signed in to change notification settings

atlassian-archive/localstack

Repository files navigation

Build Status Coverage Status PyPI Version PyPI License Code Climate

LocalStack - A fully functional local AWS cloud stack

LocalStack

Please note: The main version of this repository is https://bitbucket.org/atlassian/localstack, please raise PRs against that repo.

LocalStack provides an easy-to-use test/mocking framework for developing Cloud applications.

Currently, the focus is primarily on supporting the AWS cloud stack.

LocalStack spins up the following core Cloud APIs on your local machine:

Additionally, LocalStack provides a powerful set of tools to interact with the cloud services, including a fully featured KCL Kinesis client with Python binding, simple setup/teardown integration for nosetests, as well as an Environment abstraction that allows to easily switch between local and remote Cloud execution.

Requirements

  • make
  • python
  • pip (python package manager)
  • npm (node.js package manager)
  • java/javac (Java runtime environment and compiler)

Installation

To install the tool and all its dependencies, run the following command:

make install

This will install the required pip dependencies in a local Python virtualenv directory .venv (your global python packages will remain untouched), as well as some node modules in ./localstack/node_modules/. Depending in your system, some pip/npm modules may require additional native libs installed.

Testing

The project comes with a set of unit and integration tests which can be kicked off via a make target:

make test

Running the infrastructure

The Makefile contains a target to conveniently run the local infrastructure.

make infra

Then you can point your aws CLI to use the local infrastructure, for example:

aws --endpoint-url=http://localhost:4568 kinesis list-streams
{
    "StreamNames": []
}

If you are accessing the cloud APIs from within yout Python code, you can also use boto3 and use the endpoint_url parameter to connect to the respective service on localhost. See localstack.utils.aws.aws_stack for convenience methods to connect to the local services.

Integration with nosetests

If you want to use LocalStack in your integration tests (e.g., nosetests), simply fire up the infrastructure in your test setup method and then clean up everything in your teardown method:

from localstack.mock import infra

def setup():
    infra.start_infra(async=True)

def teardown():
    infra.stop_infra()

def my_app_test():
    # here goes your test logic

See the example test file tests/test_integration.py for more details.

Web Dashboard

The projects also comes with a simple Web dashboard that allows to view the deployed AWS components and the relationship between them.

make install-web
make web

Contributing

We welcome feedback, bug reports, and pull requests!

For pull requests, please stick to the following guidelines:

  • Add tests for any new features and bug fixes. Ideally, each PR should increase the test coverage.
  • Follow the existing code style (e.g., indents). A PEP8 code linting target is included in the Makefile.
  • Put a reasonable amount of comments into the code.
  • Separate unrelated changes into multiple pull requests.

Please note that we need to collect a signed Contributors License Agreement from each individual developer who contributes code to this repository. Please refer to the following links:

License

Copyright (c) 2016 Atlassian and others.

LocalStack is released under the Apache License, Version 2.0 (see LICENSE.txt).

We build on a number of third-party software tools, with the following licenses:

Third-Party software License
Python/pip modules:
airspeed BSD License
amazon_kclpy Amazon Software License
boto3 Apache License 2.0
coverage Apache License 2.0
docopt MIT License
elasticsearch Apache License 2.0
flask BSD License
flask_swagger MIT License
jsonpath-rw Apache License 2.0
moto Apache License 2.0
nose GNU LGPL
pep8 Expat license
requests Apache License 2.0
sh MIT License
subprocess32 PSF License
Node.js/npm modules:
dynalite MIT License
kinesalite MIT License
Other tools:
Elasticsearch Apache License 2.0

About

⚠️ **Note**: This repository is no longer actively maintained (see README below) ⚠️

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published