LocalStack – A fully-functional local AWS cloud stack
github.com
github.com
edit: Extra URL
They seem to be piling all their energy into creating mocks for new (paid) services when it might be worth consolidating as the original mocks have a lot of issues.
- Documentation is non-existent, expect to trawl through github issues to work out how something works as it’s quite opaque (api gateway invocation)
- CloudFormation implementation is completely broken (no intrinsic functions) so unless your stack is simple you’re pretty much required to use any AWS api based devops tools (e.g. Terraform)
- API’s are not fully complete, means terraform either breaks on redeploy when it tries to get a resources status or at best case triggers redeploy of certain resources each time (the most exotic thing we’re using is SNS)
- Test suite is...light, seen a few things go through their CI and break it
- There’s a bit of non-consistent behavior - you’ll set an env var and find it’s not implemented for a certain case and be left scratching your head
- Expect to have to make pull requests yourself to fix things
This isn’t a winge, I understand it’s partially open source and you can just fix the issues yourself when they come up like we are doing. But just a heads up for who may naively look at it and think it’s a silver bullet...you’ll have to go through all these steps.
I usually prefer to develop against as-live-setup-as-makes-sense, because test environments often miss something critical; however, it is often hard to verify (on both test and live systems) error condition behaviour - to debug response to S3 errors or resource exhaustion, you actually need them to happen.
Looks like this project does provide for testing these conditions. Neat.
What this means is that if I want to test something locally its not as simply as spinning up the docker container - I also have to make a code modification for the service(s) that I want to interact with.
It's not a big deal - and the benefits of being able to test locally outweigh the minor inconvenience but it still bugs me every time
https://github.com/localstack/moto/blob/localstack/IMPLEMENT...
Overall it's a really cool project. I had some networking issues running it inside Docker though. When I would place a message on an SNS topic it would come back with an exception triggering my exception handler, however it actually did send the message to the topic. Couldn't work it out and left it. Might revisit it later but that was an annoyance for me.
Or I'll be using it fine but then I want to use shiny AWS feature X.
Terraform is in the same boat; though I've found the community keeps the functionality very up-to-date.
Can anyone assuage my fears about LocalStack?
If your application uses features that don't work in LocalStack, it can be very tricky to start using LocalStack to test that application. Conversely, if you are already using LocalStack to test/develop your application, that may discourage you from using AWS features which might be a good fit, but aren't supported by LocalStack.
Also, I would certainly recommend against solely testing with LocalStack, since you may run into situations where it behaves slightly differently than AWS, and if you develop targeting LocalStack's behavior, you could end up with bugs when AWS behaves differently in production.
If I invest in a AWS-but-not-AWS dev tool, will it be good enough?
I tried it a year or so ago when I was first starting AWS serverless dev. IIRC it supports very few services. Most of our lambdas were behind API gateway and a Cognito authorizer but localstack didn't have a Cognito user pool. We botched something together with nginx to replace CloudFront for a while.
I don't remember quite what the last straw was, but there were big gaps in what we needed. Mind you, I keep finding I'm just one more AWS service away from what I need with the real thing do I'm not sure that game ever ends.
I can't really think of a situation where this is better than mocking, because of the subtle differences that introduced here.
The development is not all in-house (and I count this as a definite strength of the project). It brings together a number of other AWS mocking libraries.
In contrast Eucalyptus was more for run-your-own-AWS in your data centre. See https://en.wikipedia.org/wiki/Eucalyptus_(software) and active code branch here https://github.com/sjones4/eucalyptus