Jets has the concept of extra environments. This can be controlled by the
JETS_EXTRA variable. By setting
JETS_EXTRA you can create additional identical environments.
jets deploy # first environment demo-dev
JETS_EXTRA=2 jets deploy # creates a demo-dev-2 environment
Interestingly, since AWS Lambda pricing is based on usage. These extra environments cost you pretty much nothing. They’re literally free until you exceed the free tier. Create 10 extra Development, Staging or UAT environments if you need them 🎉
- JETS_EXTRA - takes the highest precedence
config/application.rbextra setting - takes lower precedence
With the ability to create entire applications with just a variable change, you can use it to perform blue-green deployments.
- Create another environment
- Test it to your heart’s content
- Switch the DNS over to the new stack
- Delete the old environment