Spacelift - Overview
Spacelift is a relatively new player in the infrastructure automation game that I learned about at re:Invent 2022. I was lucky enough to get a demo there, and recently finally got some time in my schedule to actually start experimenting with it. I’ve been incredibly happy with the results.
Spacelift has a relatively decent feature set, especially for a new product, but I’m primarily using it just to automate my Terraform stuff. If you’ve seen my previous writeups on the CDK, I’ll just say that my needs began to exceed what the CDK could reasonably provide, and since I’m using Terraform in my day job it made sense to start migrating the infrastructure management to that.
Spacelift, in short, watches some indicated Github repositories for changes and when it detects them it will execute Terraform to apply those changes to my AWS account. This isn’t a wildly new idea, and I’ve built a handful of similar pipelines over time to do this same thing. Spacelift, however, introduces some really cool features that make the whole process smooth and nigh enjoyable.
I’ll be writing some more articles about my journey, but I’ll just point out a handful of the features that I’ve found especially compelling.
Private Module Repository
This is super nice. I can have my Terraform modules auto-publish to the Spacelift repository for my personal use. They even provide a test mechanism to ensure that my code isn’t totally broken before I use it.
State Management
I hate dealing with Terraform state management. Now I don’t have to.
Contexts
Contexts are, basically, shared environment variables or files made available to your Spacelift workspaces. These provide a really easy way to share data across workspaces and projects, or even just provide secrets to a particular run.
Dependencies
Your workspaces (called stacks
in Spacelift parlance) can be setup to be dependent upon each other so that when you update a substrate chunk of infrastructure, those changes are automatically triggering a build of downstream resources.
Self-Automation
Spacelift has a pretty decent Terraform module you can use to automate the tool itself, minimizing the need to do much, if any, human configuration at all.
Role Assumption
The way the AWS integration works, you can be very granular with access. really nice if you’re paranoid.
Downsides?
Just one comes to mind after 2 weeks of use:
Pricing
The pricing is very much aimed at relatively large users. The free tier is great, but lacks the cloud integration and private worker features that are needed to provide the best experience. That said, they seem to be actively soliciting and acting upon feedback from the community to make this better.
I’ll be writing some more articles about my Spacelift journey, including a short tutorial on how to use it to build and manage a simple project.