Announcing LocalStack Extensions
With LocalStack 1.0 we have introduced LocalStack Extensions that allow developers to extend and customize LocalStack. You can now use Extensions to add new services, extend existing services, and even add custom functionality.
With the LocalStack 1.0 General Availability going live last month, we announced LocalStack Extensions! LocalStack Extensions allow users to extend and customize LocalStack using pluggable Python distributions.
Setting up LocalStack Extensions
LocalStack Extensions is part of our Pro offering. To get started with using LocalStack Extensions, first log in to your account using the LocalStack CLI:
After a log-in, you can get started using the LocalStack Extensions API:
Using LocalStack Extensions?
LocalStack Extensions is a Python application that runs alongside the main process in the LocalStack Docker container. LocalStack Extensions allows you to hook into different lifecycle phases of LocalStack and execute custom code or modify LocalStack’s HTTP gateway with custom routes and server-side code.
We have the following extensions handy for our users to get started with:
To install an extension, specify the name of the pip
dependency that contains the extension. For example, for the official Stripe extension, you can either use the package distributed on PyPI:
You can also install it directly from a Git repository:
Creating LocalStack Extensions
We invite developers using LocalStack to mock and emulate AWS infrastructure locally to help us build an ecosystem around LocalStack Extensions. LocalStack Extensions can be created using our core Extensions API in our core codebase.
To create a new LocalStack Extension, you can use our Extensions CLI to access our developer commands that allows you to create new Extensions, and toggle local development mode for Extensions. With the developer mode toggled on, Extensions can be mounted into the LocalStack container, hence you don’t need to re-install them every time you change something.
To create a new Extension, you can use the localstack extensions dev new
command:
It will kick-start your all-new LocalStack Extension project with all the boilerplate code you need to get started with.
You can then run make install
in the newly created project to make a distribution package. To start developing your Extension and mount it into the LocalStack container, use the localstack extensions dev enable
command:
Start LocalStack with EXTENSIONS_DEV_MODE=1
to mount the Extension into the LocalStack container:
You will notice the following in your logs when the Extension is mounted into the LocalStack container:
What’s next?
To further look into the developer docs to build new LocalStack Extensions, look into our developer documentation and API code.
As a developer, some of the exciting use-cases of LocalStack Extensions are:
- Integrate custom service emulators (like Stripe or more) with LocalStack
- Load Python-based initialization scripts
- Instrument AWS requests before they reach your Lambdas
- Intercept AWS requests for logging or auditing
The sky is the limit!
Conclusion
LocalStack Extensions is currently in preview and is continually evolving. We use the Discussion Pages to share updates on our product and to communicate the roadmap. We look forward to working closely with our growing community and engaging via Discussion Pages on all the upcoming exciting upcoming topics and upcoming updates.
Let’s work together to create a superb developer experience and make cloud development fun! 🚀