10 ms·
Localstack – Local AWS Emulator
- gigatexal 5y agoDoes a similar such thing exist for GCP?
- reilly3000 5y agoThere is some coverage within the gcloud sdk: https://cloud.google.com/sdk/gcloud/reference/beta/emulators https://cloud.google.com/sdk/gcloud/reference/beta/emulators The firebase stack can run 100% local as well.
- dkuebric 5y agoHere's a rundown of the local stack components we've found, as well as some we've developed, for GCP at FullStory: https://github.com/fullstorydev/emulators https://github.com/fullstorydev/emulators
- EADGBE 5y agoCan I use it in conjunction with something like CDK? I’m trying to learn the AWS CDK, but I would feel much better if I could run all these orchestrations on a local docker instead of a real AWS account. …And just trust that I destroy them before they incur cost.
- whummer 5y agoAbsolutely - CDK under the covers generates CloudFormation templates, which deploy natively on LocalStack. Certainly a great use case for local dev&test - especially if you want quick feedback cycles, ability to destroy the stack immediately, etc. There's also a "cdklocal" command line which should make it fairly easy to get started with local CDK development: https://github.com/localstack/aws-cdk-local https://github.com/localstack/aws-cdk-local
- chrsig 5y agoi wish aws...and to be honest, most cloud providers put more effort into the development experience. they have local dynamo, but i believe that's the only official appliance they provide. I think it's especially necessary for the proprietary products -- dynamo being a great example. I'll take a moment to call out snowflake for this as well -- it's really frustrating to not be able to quickly (within milliseconds) and easily (i shouldn't need to get credentials from elsewhere in my org) setup & teardown databases while under test.
- emersonrsantos 5y agoI used Serverless framework to develop locally many times, it works very well for my case.
- thrauat 5y agoi think cloud providers have little incentive to help you develop and test everything locally, since they benefit more from onboarding you quickly into using their infrastructure, which they can much better monetize on. it seems to me that a completely local cloud stack would be threatening to cloud providers also in that you can then start running non-critical applications on-prem at no cost.
- chrsig 5y agoi don't think that's a real threat -- i don't think development environments are likely a huge income source for them, either. i think they'd be better served by letting me develop more quickly, so I can help my company grow, and presumably need (and have the budget for!) more resources in our production environment. if i'm mistaken, i think it's reasonable to have some sort of built in time limit to how long the appliance will run for, or some other way of preventing it being used for non-development purposes.
- GusEggert 5y agoThere is also Step Functions Local (https://docs.aws.amazon.com/step-functions/latest/dg/sfn-local.html https://docs.aws.amazon.com/step-functions/latest/dg/sfn-loc..., it is also integrated with LocalStack). I built it as a side project when I was at AWS, motivated by the same frustrations. The best way to get these prioritized is to request it through your account manager/SA/etc. AWS does listen closely to customer feature requests.
- gyre007 5y agoThis tool is very useful for integration testing, but unfortunately it can be rather slow.
- mdoms 5y agoYes I use localstack a lot and it's very nice but VERY slow and I can't really understand why.
- thrauat 5y agoIs it the startup time or the overall performance during runtime?
- whummer 5y agoHey - LocalStack founder here. Thanks for the feedback. We're currently investing some time and resources on refactoring the code base to improve the performance. We have some improvements in the pipeline which we should be able to roll out within the next 1-2 weeks. Performance (as well as general UX) is definitely high up on our priority list, and we'll continue to invest heavily in this area. Stay tuned! Happy for any additional suggestions and questions you may have.
- shiftpgdn 5y agoI’ve been saying for a couple of years whoever builds a tool to one click deploy an AWS alike to run on local bare metal has built the next billion dollar a year company. I know of a lot of big shops that are desperate to get out of the cloud due to 7-8 figure AWS bills but their software and engineering is too tightly wound into AWS tooling.
- IceWreck 5y agoBut AWS is huge. They employ thousands of engineers. Granted most of the complexity is due to its huge huge scale, but still it has too many features to do what youre asking. And then there are AWS exclusives like DynamoDB. Yes there are open source public/private cloud alternatives like OpenStack but they won't solve the problem of lock in and you'd still have to change all your tooling.
- sekh60 5y agoOpenStack isn't a redhat project, it is contributed to by a large number of players. Redhat, SUSE and Canonical all provide their own OpenStack service subscriptions, but one can easily deploy OpenStack with a project like OpenStack Kolla. I run it at home and it is great.
- Sanguinaire 5y agoOpenStack is an over-complicated mess. Most enterprise IT orgs already struggle to hire the people with skills to operate a public cloud account, nevermind having to build the underlying infrastructure as well.
- sekh60 5y agoI suppose it is complicated, just a homelabber here, but I don't think it's that bad. I deployed my cluster at home using kolla, and I've had relatively few hiccups that non-sysadmin/non-coder me couldn't get around. I've had the same cluster going for a few openstack releases now. Kolla really makes it easy. That said before I found Kolla I did deploy openstack manually a few times before messing things up and having to restart.
- whummer 5y agoHey all - LocalStack co-founder here. Great to see this article trending. :) Happy for any additional suggestions and questions you may have. Looking forward to getting your feedback!
- hw8kw13 5y agoHow would you differentiate yourself from a tool like Moto, in terms of testing? https://github.com/spulec/moto https://github.com/spulec/moto
- whummer 5y agoGreat question - we're working very closely with moto, in fact our team very actively contributes to the moto core on a regular basis. The main differentiator is that moto is a Python library that mocks out / implements the AWS APIs, whereas we see LocalStack as a platform that aims to support the end-to-end development lifecycle for your cloud apps. A lot of the work we do in LocalStack is to create a seamless dev experience in your local environment - providing local DNS integrations, persistence features, Lambda code mounting, CI integrations, transparent injection of "localhost" endpoints into AWS SDKs (e.g., for your Lambda functions), and much more. Also, today we already provide some fairly sophisticated integrations - e.g., our Athena API which allows you to run your SQL-like big data queries natively over the local S3 filesystem. This is out of scope for moto, but a big focus area for us. Our aspiration is that you can take any (AWS) cloud app and deploy it natively to LocalStack - which is already the case in many scenarios, and improving on a daily basis. Btw, we're currently working on revamping/polishing our docs with lots of more content and details - we'll push out an update to https://localstack.cloud/docs https://localstack.cloud/docs in the next couple of days!
- DandyDev 5y agoLocalstack Pro looks quite nice and comprehensive, but the CI pricing seems to really discourage proper continuous integration best practices. At 10 cents per run you're encouraging developers to run their CI pipelines as little as possible, while ideally you'd run CI on each commit and you'd commit often, probably 10s is times a day. In that case Localstack Pro for CI would get costly very quickly. Why not have CI pricing per project/repo. Regardless of how often it runs.
- rezafuru 5y agoIt's not just an amazing project, but also has an amazing community around it!
- whummer 5y agoAbsolutely - couldn't agree more. This project would have never been possible without such an amazing community. Kudos to you all!
- rickstanley 5y agoIs there any equivalent for Azure?
- whummer 5y agoHi, we do have Azure on our roadmap - recently launched a beta program with a few selected customers. We'd love to learn more about your use case - if you're interested, please shoot us an email to info@localstack.cloud . Thanks!
- ismailegilmez 5y agoThe LocalStack community is so supportive and the team is lovely!
- richardfey 5y agoYou can also create resources using a YAML file, I found that feature extremely useful!
- whummer 5y agoYes, great point - you can define and deploy your resources to LocalStack using CloudFormation (either as YAML or JSON files). This makes it very easy to maintain and exchange stacks in a platform-neutral way. Btw - we're also offering integrations for Terraform (https://registry.terraform.io/providers/hashicorp/aws/latest/docs/guides/custom-service-endpoints#localstack https://registry.terraform.io/providers/hashicorp/aws/latest...) and Pulumi (https://github.com/localstack/pulumi-local https://github.com/localstack/pulumi-local), among others.
- sozal 5y agoLocalStack is super useful tool for developers during local development and e2e testing. We have been using it for one year and it really helped us to debug and find issues without deploying to real AWS environment.
- arpna 5y agoi got a chance to learn this tool and it’s super useful tool for developers during local development and e2e testing
- arpna 5y agoi got the chance to learn this tool and it is super useful tool for developers during local development and e2e testing
- dafa 5y agoSuper useful tool, we use it as part of our CI pipeline to test our Lambdas, works great
- brycelarkin 5y agoHow does Localstack compare to SAM and Serverless local? Is it easier to use? Have a couple lambda services backed by API GW that I’d like to have a better dev env for.
- whummer 5y agoOne of the main differentiators we see is that frameworks like SAM or Serverless are pretty opinionated about how your app should be defined/structured/implemented. These frameworks work absolutely great, as long as you 100% buy in to their way of doing things. This creates a certain lock-in effect, and may make it harder to switch to a different framework/approach later on. LocalStack takes a different approach by working on the API emulation layer - hence making it easier to switch and integrate with various different application development frameworks. Btw - there's also a Serverless plugin, as well as a "samlocal" command line - in case you'd like to give it a try: https://github.com/localstack/serverless-localstack https://github.com/localstack/serverless-localstack https://github.com/localstack/aws-sam-cli-local https://github.com/localstack/aws-sam-cli-local
- brycelarkin 5y agoAwesome! I’ll give it a try
- k8sToGo 5y agoHmm this will come in handy when writing my Terraform scripts.
- whummer 5y agoYep, local Terraform testing is a great use case - we're seeing a lot of usage in this space. Here are some some pointers to get started with the provider configuration: https://registry.terraform.io/providers/hashicorp/aws/latest/docs/guides/custom-service-endpoints#localstack https://registry.terraform.io/providers/hashicorp/aws/latest... We'll soon publish some more details on the TF integration in the LocalStack docs... Side note - similar to the *.tfstate file maintained by Terraform (storing metadata about resource deployment states), we're increasingly making use of persistence files (called "local cloud pods") that allow you to easily store the state of your LocalStack instance, share it with team members, keep track of changes over time, etc. Really nifty feature...
- surfer7837 5y agoI prefer mocking my AWS calls, so much more lightweight and means exert developer doesn’t have to install local stack
- whummer 5y agoInteresting! Staying lightweight and zero-dependency is certainly a good argument. Out of curiosity - which programming language(s) are you / your team developing in? Do you have a notion of how much (%) of your time, approximately, goes into maintaining the mocks - does it scale / pay off over time?
- qaq 5y agoWell if they use https://github.com/spulec/moto https://github.com/spulec/moto they don't have to maintain the mocks
- deleted 5y ago[deleted]
- surfer7837 5y agoWe use Typescript and jest for the mocks. Probably about 10%, they’re very simple mocks, all they do is return success and in a few unit tests we make them return failure and then test how our app responds. I can’t really say if it pays off but it has caught some issues, would like to expand them more and implement more logic in then to check arguments etc but haven’t been able to yet. This article is similar to what we’ve done https://dev.to/elthrasher/mocking-aws-with-jest-and-typescript-199i https://dev.to/elthrasher/mocking-aws-with-jest-and-typescri... We also have a pipeline that does e2 work tests and canary releases to hopefully limit the blast radius. If we encounter >10 errors in a 1 minute period we roll back and the team are alerted
- itake 5y agoDo you mock for local dev too?
- jpgvm 5y ago
- TylerJaacks 5y agoI wish some of the services weren't locked behind a paywall.
- thdxr 5y agoIt's impressive what Localstack has been able to do to keep up with AWS. However for my own projects, we consider local development like this an anti-pattern. IaC tools like Terraform/CDK/SST make it easy to spin up environments for each developer in the cloud. This may sound crazy at first but would recommend giving it a shot. If you're fully taking advantage of managed AWS services the best development environment is running everything in AWS. There's definitely some friction but you reduce the "was working on my machine but not in production" situations.
- TameAntelope 5y agoI'd like to better understand how you define local development specifically as an "anti-pattern". What are your criteria for using that term, and what other examples might also fall into a similar category?
- thdxr 5y agoOthers have written about this better than I can, here's an article: https://dev.to/garethmcc/why-local-development-for-serverless-is-an-anti-pattern-1d9b https://dev.to/garethmcc/why-local-development-for-serverles... Paul Swail has spoken a lot about this and has an upcoming book around the concept: https://serverlesstestinghandbook.com/ https://serverlesstestinghandbook.com/
- TameAntelope 5y agoI'm not sure I agree with the linked article, are there any other (accessible, and existent in the present) resources you used to arrive at this decision? For one, the article assumes the tools you use to replicate your production environment locally aren't accurate; with localstack, they are accurate. It's seamless, truly. I recommend you give it a try instead of spending the extra cash to have your developers deploy into the cloud constantly. Another thing to note is that this seems only true for a specific architecture, if you're writing serverless functions. Not everyone is or should be doing that, so I'm not sure "you should always test in the cloud" applies as a "context free" rule. Finally, it sounds like the author had a lot of trouble getting his local environment to work. Maybe folks who have a bit more experience working with the technologies involved in their services don't have that problem, and it's a little arrogant to assume that, just because you had a problem, that it's a problem for everyone else, too. Overall, I just don't think commenting, "This service nice, but using it is an anti-pattern" was quite as productive of a comment, in general, as you meant it to be.
- kjgkjhfkjf 5y agoI'm happy that this exists, but it really should be a product supported and maintained by AWS rather than the user community, to ensure consistency with the real AWS services.
- DarthNebo 5y agoThis is great, would be useful to test scaling at some level too!
- heisen_berg 5y agoLocalstack is our favorite for developing our application on AWS environment. It saves us from redeploys and AWS env based issues by simulating services on locally
- soheil 5y agoSeems like a service that should be offered by AWS.
- phendrenad2 5y agoLocalstack is great but I wish it wasn't needed. Engineers have become too comfortable stringing cloud services together with minimal code in a way that makes them unable to be run locally. This is also a hard problem to fix after the fact. If you make a mock of the cloud service, how do you know you captured all of the functionality? How do you know your mock won't pass all of the tests, but the real cloud server will behave differently and break production? Greenfield you can anticipate this and explicitly test all behavior locally.