Scenario-Based Spacelift Interview Questions (2027)
26 scenario-based Spacelift interview questions with answers: stuck runs, credentials, state, drift, Rego policies, push sampling and stack dependencies.
Scenario-based Spacelift interview questions describe a production problem, such as a run stuck in the queue, a plan that wants to destroy a database, drift found overnight, or a dependent stack using stale outputs, and ask how you would diagnose and fix it. Strong answers name the symptom, the evidence you would check, the fix and the guardrail that prevents a repeat.
This post has 26 scenarios for engineers who already know the basics. For definitions, start with the most asked Spacelift questions for freshers; the full reference list is our Spacelift engineer interview questions.
Key takeaways
- Interviewers grade the order of your thinking: symptom, evidence, cause, fix, prevention.
- Most Spacelift incidents trace back to one of five areas: workers, credentials, state, policies or stack dependencies.
- Know where evidence lives: run logs and states, the Resources view, policy evaluation samples, worker pool status, and the cloud provider's own logs.
- Drift detection needs private workers, runs on cron schedules you define, and can reconcile automatically.
- Prevention usually means a policy, a dependency, a cloud integration or a smaller stack.
A simple answer frame
Use the same five steps for every scenario. First, restate the symptom in one sentence so the interviewer knows you heard it. Second, say what you would look at first and why: the run log, the run state, the policy samples, the worker pool page or the cloud audit log. Third, name the most likely cause and one alternative. Fourth, give the fix, including any safe way to test it, such as a proposed run. Fifth, say what you would change so it does not happen again. This takes about a minute out loud, and it shows you work methodically under pressure, which is what a scenario round is measuring.
| Area | Where to look first | Typical prevention |
|---|---|---|
| Workers | Run state, worker pool page | Pool sizing, drift concurrency limits |
| Credentials | Initialization and planning logs, cloud audit log | Cloud integrations with short-lived roles |
| State | Tasks such as state list, Resources view | Smaller stacks, import instead of recreate |
| Policies | Policy samples and evaluation results | Warn first, test with samples, then deny |
| Dependencies | Dependency graph, output references | Explicit stack dependencies instead of manual order |
Run and worker scenarios
1. Runs stay in the queued state for a long time. What do you check?
Queued means no worker has picked the run up. Check the worker pool the stack uses: are any workers connected, are they busy, did a recent change to the private pool's launcher or credentials break registration? If a big drift schedule fired at the same time, it may be consuming capacity. Fix by restoring or scaling workers. Prevent it with monitoring on the pool and a concurrency limit for drift runs, which Spacelift lets you set per pool.
2. A run fails during initialization with a provider download error.
Read the init log. Private workers often sit behind a proxy or firewall that blocks the provider registry. Confirm by running the same init from a worker host. Fix by allowing the registry, configuring a mirror, or baking providers into a custom runner image. Pin provider versions with a lock file so a new version does not surprise you.
3. Plans succeed on public workers but fail on a new private pool.
Compare the environment: runner image, network access, attached contexts and cloud credentials. Private workers often lack outbound access or use a different image. Fix the gap, then run a proposed run on a test stack before moving production stacks.
4. A tracked run has been unconfirmed for days.
It is waiting for a person to confirm. A stale plan is risky because the world may have changed. Discard it and trigger a fresh run so the plan reflects current state. Prevent it with notification policies that alert the owning team when runs wait for confirmation.
Credentials and access scenarios
5. Runs start failing with access denied after a security change.
Check whether the cloud role trusted by the Spacelift cloud integration changed, or whether a permission boundary was added. The cloud provider's audit log shows the denied call. Restore the needed permission with least privilege, and keep the role definition in code so the change is reviewed next time.
6. Someone stored long-lived AWS keys in a context. How do you remediate?
Move the stacks to a cloud integration that issues temporary credentials, rotate and delete the old keys in AWS, and remove the variables from the context. Add a plan or login policy check if your team wants to block that pattern in future.
7. A developer can confirm runs on production stacks they should only read.
Review space membership and roles. Production stacks should live in a space where the developer has read access only. The documentation recommends space access control over the older access policies, so fix it there, then add an approval policy so production applies need a reviewer from the owning team.
8. Secrets appear in run logs.
The value was probably printed by a hook or a provider output, not by Spacelift's secret variables, which are masked. Mark outputs as sensitive in Terraform, remove the echo from the hook, rotate the exposed secret, and review who could see the log.
State and resource scenarios
9. A plan wants to destroy and recreate a database.
Stop: do not confirm. Read the plan to find the attribute forcing replacement, often a renamed resource or a changed immutable field. If it is a rename, use a moved block or a state move in a task so Terraform knows it is the same resource. Prevent it with a plan policy that denies deletion of databases unless an override label is present.
moved {
from = aws_db_instance.main
to = aws_db_instance.primary
}
10. A resource was created manually and now the plan tries to create a duplicate.
Import it into state, either with an import block in code or a task running the import command, then run a proposed run to confirm the plan is clean. Use drift detection and tagging rules to catch manual creation sooner.
11. Two stacks manage the same resource.
Each stack will fight the other, and plans flip back and forth. Find the duplicate through the Resources view or by searching state, pick one owner, remove the resource from the other stack's state, and document ownership. Clear stack boundaries prevent this.
12. A stack has grown so large that plans take a long time.
Split it by lifecycle and blast radius, for example network, shared data and application. Connect the new stacks with stack dependencies so outputs flow automatically. Smaller stacks also make policies and approvals easier to reason about.
Drift scenarios
13. Drift detection found changes overnight. What next?
Look at the drifted resources and the cloud audit log to find who changed what and why. If the change was an emergency fix, put it into code. If it was a mistake, reconcile back to the code with a tracked run. Then talk to the team so the next emergency change is made through a pull request.
14. Should drift reconciliation be automatic?
For low-risk stacks, yes, because it keeps state honest. For production databases or networking, prefer alerting and manual review, because an automatic revert of an emergency fix could cause an outage. Reconciliation follows the stack's normal rules, including plan policies, so policies still apply.
15. Drift schedules cannot be created for a stack.
The stack likely uses public workers or a private pool where drift detection is disabled. Drift detection only works on private workers, and pools can switch it off. Move the stack to a pool that allows it.
16. Drift runs are flooding workers every hour.
Spread the cron schedules, lower their frequency for stable stacks, and set a concurrency limit for drift runs on the pool so normal deployments are not starved.
Policy scenarios
17. A new plan policy blocks every run.
Use the policy samples to evaluate the rule against recent inputs and find the bad condition, often a field name that does not exist in the input. Roll back to a warning, fix and test against samples, then enforce. In future, ship new policies as warnings first.
18. A pull request was opened but no proposed run appeared.
Attach a push policy with sample := true and open another pull request. If the policy records a sample, Spacelift received the event and your push policy logic decided to ignore it, so read the replayed input to find the condition that failed. If there is no sample at all, Spacelift never got the event, so check the version control integration, its webhook delivery log and whether the repository is connected to the right space. Note that only administrators may be able to read sampled input content, so involve one early.
19. A stack picks up the wrong region even though the shared context is correct.
Check precedence. A variable set on the stack beats every context, and explicitly attached contexts beat auto-attached ones. Someone probably set the same variable directly on the stack during testing, or a second context with a lower priority number defines it too. Remove the duplicate, keep shared values in one context, and document which contexts each stack should carry.
20. Pushes to a monorepo trigger runs on every stack.
Write a push policy that compares changed files with each stack's project root and only triggers when relevant files change. Test it on a few stacks before attaching it everywhere.
21. Production needs two approvals, but only for deletes.
Write an approval policy that reads the plan and requires two approvals when any resource is being deleted, and one otherwise. Restrict who can approve by role or team in the policy.
22. An old initialization or task policy still exists. Should you keep it?
The documentation lists both as deprecated and points to approval policies as the replacement. Rewrite the logic as an approval policy, test it with samples, then detach the old one.
Dependency and pipeline scenarios
23. An application stack used an old subnet ID after the network stack changed.
The output was copied by hand or the stacks were not linked. Create a stack dependency with output references so the application stack receives the new value and runs after the network stack finishes.
24. A change needs to roll through dev, staging and production in order.
Use one stack per environment tracking the same code, with stack dependencies or a promotion flow, and approval policies on production. Confirm the staging run finished cleanly before production plans.
25. A module update broke several stacks.
Pin module versions in each stack, publish modules through the module registry with test cases, and roll new versions out to a few stacks first. Revert the pin to recover.
26. Leadership asks for an audit of every production change last quarter.
Export run history for production stacks, including commit, who confirmed and the plan summary, and use notification policies or webhooks to keep events in your own logging system. Mention that keeping your own copy avoids depending on one tool's retention.
How to practise these scenarios
Pick six scenarios and practise them out loud with a timer, one minute each. Then build a small lab: two stacks with a dependency, one plan policy and one approval policy. Break things on purpose, such as removing a role permission or renaming a resource, and walk through the fix. Write down, for each break, the exact log line or run state that told you what was wrong. Interviewers often follow up with "how did you know?", and an answer that names the evidence ("the run sat in queued and the pool showed zero connected workers") is far stronger than a general description. For the Terraform side of these answers, the Terraform scenario questions pair well with this page, and who should control access to IaC backends covers the access questions from another angle. The DevOps interview questions hub lists keepers for every other tool.
Our Terraform training includes state, modules, policies and pipeline labs, in the Kharadi, Pune classroom and live online.
Official references
FAQs
How should I answer a Spacelift scenario question?
State the symptom, the evidence you would check, the likely cause, the fix and how you would prevent it. Keep it to about a minute.
Why would a Spacelift run stay queued?
No worker has picked it up. Check that the worker pool has connected, free workers and that drift runs are not consuming all capacity.
Can drift be fixed automatically in Spacelift?
Yes. With reconciliation on, detected drift triggers a tracked run that applies the code again, following the stack's normal rules and policies.
How do I stop a plan from deleting a database?
Do not confirm the run, find why replacement is forced, use a moved block or import if it is a rename, and add a plan policy that denies such deletions.
Which Spacelift policies are deprecated?
The documentation lists initialization and task policies as deprecated and points to approval policies instead. Trigger policies are mostly replaced by stack dependencies.
How do outputs move between Spacelift stacks?
Through stack dependencies with output references, which pass values from one stack to the next and set the run order.
What's Your Reaction?
Like
0
Dislike
0
Love
0
Funny
0
Angry
0
Sad
0
Wow
0