Programmatic access to Spacelift managed state
We have thousands of stacks. The definition of the stacks is multilayered. (I.e. we have a “base”. The on top of the base, we build a “foo” and “bar” type. Then, for example, we could add an “aaa” on top of foo. And then, eventually, we create a stack on top of those other definitions.) This works fine in most cases. But, when we have to make a change to the “base” layer, we have to manually view any proposed changes. For even a dozen or so, this becomes painful. It is completely untenable to do that for hundreds, to say nothing about 1000s.
This would be much easier if we had a way to reference the state locally. Thus, we could do a local terraform plan just to figure out the scope of a proposed change.
To be clear; I am only talking about “read only” access to the state.
Ideally, we could annotate that TF somehow so that we did NOT have to make any change to run tf plan locally. And however it was set up, it would not interfere with the normal “file injection” Spacelift does.
FTR; I am aware of:
Doing that for dozens of states/stacks is EXTREMELY time consuming. And it would be a non-starter for hundreds or more.
- Workaround
- Problem
Log in to comment and vote
Comments8
Gold Pear
Feb 21
Please allow us to download terraform state using spacectl. Having to do use the task workaround is quite inconvenient.
Black Breeze
Feb 13
Thanks for taking the time to write this up Craig. I hope you don’t mind me challenging you a bit here though. Reading and re-reading your description, I’ve been wondering…
What would you rather have us do - improve the experience of reviewing changes in bulk, or provide a separate API that you still need to build custom logic upon?
And perhaps we could go even deeper? You wrote:
Why is that? Is there perhaps a building block missing in Spacelift that would allow you to do things natively that you currently need to work around?
Let’s change tack a bit here. Say you were to design an ideal system from scratch for your particular workflow, what would that look like?
Gold Pear
Mar 25
@Marcin Wyszynski any chance we will get this feature. Splitting out terraform state is currently not very user friendly. Please allow someone with the appropriate permission to be able to download the current state via spacectl. We are always optimizing our stacks to split them as needed and this would go along way to make that process more user friendly instead of using have to setup a bucket + run a task. The fact that I can upload a state but not download state is inconsistent.