Spacelift Engineer Interview Questions with Answers (2027)

40 Spacelift engineer interview questions with answers: stacks, runs, contexts, worker pools, stack dependencies, drift detection and Rego policies.

Sep 18, 2025 - 14:29
Nov 10, 2026 - 09:27
 0  97
Spacelift Engineer Interview Questions with Answers (2027)

Spacelift engineer interview questions test whether you can run infrastructure as code at team scale on Spacelift: stacks and runs, contexts, worker pools, stack dependencies, drift detection, cloud integrations and Rego policies (login, access, approval, plan, push, trigger and notification). Expect Terraform or OpenTofu fundamentals first, then Spacelift workflow design and troubleshooting.

This guide has 40 questions with answers for platform, DevOps and infrastructure engineers who work with Spacelift, grouped by experience level and followed by scenarios. For a longer general bank, see our 70+ Spacelift interview questions. Spacelift features were checked against the Spacelift documentation in November 2026. Features and plan availability change, so confirm details for the version you use, especially on self-hosted installs.

Key takeaways

  • A stack is Spacelift's unit of work: a source repository and path, a tool (such as Terraform, OpenTofu, Terragrunt, Pulumi, CloudFormation, Kubernetes or Ansible), settings, and its state.
  • Tracked runs come from the tracked branch and can change infrastructure. Proposed runs come from pull requests and only plan.
  • Policies are written in Rego and run by Open Policy Agent. Login policies are global; the others are attached to stacks or modules, manually or through autoattach: labels.
  • Initialization and task policies are deprecated in favor of approval policies, and most trigger policy uses are replaced by stack dependencies.
  • Prefer cloud integrations that issue short-lived credentials over long-lived keys stored in contexts.
  • Terraform knowledge is still the base. Our 120+ Terraform interview questions cover it in depth.

Spacelift concepts at a glance

ConceptWhat it isCommon interview angle
StackRepo, path, tool, settings and state for one piece of infrastructureHow you split stacks
RunA tracked or proposed execution of a stackRun states and confirmation
ContextA reusable bundle of environment variables, mounted files and hooksSharing config without copying
Worker poolPublic (Spacelift-managed) or private (your infrastructure) workersNetwork access and security
Stack dependencyAn ordered link between stacks, with output referencesReplacing trigger policies
PolicyRego rules for login, access, approval, plan, push, trigger, notificationGuardrails and approvals
SpaceA folder-like boundary for access control and sharingMulti-team setups
Module registryPrivate registry for versioned modules with testsReusable modules

Freshers and early-career (1 to 14)

1. What is Spacelift?

Spacelift is an infrastructure as code orchestration platform. It runs tools such as Terraform, OpenTofu, Pulumi, CloudFormation and Ansible from your Git repositories, adds policy checks and approvals, manages state and credentials, and gives teams a shared view of runs and resources. It sits where a general CI system would otherwise run your IaC scripts.

2. Why use Spacelift instead of running Terraform in a generic CI pipeline?

A generic pipeline can run terraform apply, but you have to build state locking, approvals, policy checks, drift detection, stack ordering and access control yourself. Spacelift provides those as features, which reduces custom pipeline code. The trade-off is another platform to learn and pay for.

3. What is a stack?

A stack links a Git repository, branch and project root to one IaC tool, its settings and its state. Each stack usually maps to one environment of one component, such as "networking, production".

4. What is the difference between a tracked run and a proposed run?

A tracked run is triggered from the stack's tracked branch and can apply changes. A proposed run is triggered by a pull request or a push to another branch and only produces a plan, which shows reviewers what would change.

5. What does "unconfirmed" mean for a run?

The plan finished and the run is waiting for someone to confirm before applying. This happens when the stack does not have autodeploy turned on. A reviewer reads the plan and confirms or discards it.

6. What is autodeploy?

A stack setting that applies a tracked run automatically after a successful plan, without manual confirmation. Teams often use it for lower environments and keep manual confirmation or approval policies for production.

7. What is a context?

A context is a reusable set of environment variables, mounted files and hooks that you attach to many stacks. For example, a context can hold shared provider settings for all production stacks. Contexts can be attached manually or automatically through labels.

8. How does Spacelift handle Terraform state?

Spacelift can manage the state for a stack, or you can keep your own backend such as an S3 bucket with locking. Managed state removes backend setup but keeps the state in Spacelift. The choice is made when the stack is created. Read our post on remote state management in Terraform for the background.

9. What are public and private worker pools?

Public workers are run by Spacelift. Private workers run in your own infrastructure, which lets runs reach private networks and keeps credentials and code inside your environment. Private workers are common in regulated companies.

10. What language are Spacelift policies written in?

Rego, the policy language of Open Policy Agent. Spacelift supports Rego v0 and v1 and recommends v1 for new policies. Policies can be tested locally with opa test.

11. Name the main policy types.

Login, access, approval, plan, push, trigger and notification are the main ones. Spacelift also lists intent policies for Intent projects. Initialization and task policies still appear in the docs but are deprecated in favor of approval policies.

12. What is a push policy for?

It decides how a Git push or pull request event is interpreted: whether it triggers a tracked run, a proposed run, or is ignored. Teams use it to ignore changes outside a stack's folder or to run only on certain labels.

13. What is drift detection?

A scheduled proposed run that compares real infrastructure with the code and state. If something was changed outside IaC, the run reports drift, and you can optionally have Spacelift reconcile it with a tracked run. Check the docs for worker pool requirements on your plan.

14. What is spacectl?

Spacelift's command line tool. You can use it to trigger and follow runs, view logs, work with stacks and run local previews of changes, which helps in scripts and local troubleshooting.

2 to 5 years of experience (15 to 28)

15. Write a plan policy that blocks deleting any database.

package spacelift

deny contains msg if {
  some rc in input.terraform.resource_changes
  rc.type == "aws_db_instance"
  "delete" in rc.change.actions
  msg := sprintf("Deleting %s is not allowed", [rc.address])
}

Plan policies read the plan JSON. A deny result fails the run, while a warn result shows a warning that reviewers can see. Test policies against sample plan input before attaching them to production stacks.

16. How do you require two approvals for production applies?

Attach an approval policy to production stacks that approves the run only when at least two reviewers have approved and nobody has rejected. Combine it with autodeploy turned off or with the approval stage so nothing applies without it. Keep the reviewer group in your identity provider, not hard-coded user names.

17. How do you attach a policy to all production stacks automatically?

Label the stacks (for example env:prod) and give the policy the label autoattach:env:prod. Every stack with that label gets the policy, including new ones. autoattach:* attaches to all stacks and modules. Login policies cannot be auto-attached because they are global.

18. How do you pass outputs from a networking stack to an application stack?

Create a stack dependency from the application stack to the networking stack and add output references that map the networking outputs (such as subnet IDs) to inputs on the application stack. When the networking stack applies, Spacelift runs the dependent stack in order with the new values.

19. Why are stack dependencies preferred over trigger policies?

Stack dependencies are declared on the stacks, run in a defined order and can pass outputs directly. Trigger policies need Rego logic to decide which stacks to start and do not pass values. Spacelift's docs describe trigger policies as mostly replaced by stack dependencies.

20. How should cloud credentials reach runs?

Use Spacelift's cloud integrations for AWS, Azure or Google Cloud, which give each run short-lived credentials through role assumption or federation. Avoid storing long-lived access keys in contexts. Scope each integration to the stacks and permissions it needs.

21. What are hooks and when would you use them?

Hooks are commands that run before or after phases such as init, plan and apply. Use them to install a tool, run a linter or security scanner, or generate files. Keep hooks short and versioned in the repo or a context so runs stay reproducible.

22. How do you organize Spacelift for several teams?

Use spaces to separate teams or business units, with access rules controlling who can read or manage stacks in each space. Put shared contexts, policies and modules in a parent space so child spaces can inherit them where configured. Map access to groups from your identity provider.

23. A proposed run shows a plan, but the PR has no comment or status check. What do you check?

Check the VCS integration for the repository, that the stack points at the right repo and branch, and whether a push policy is ignoring the event. Check the notification settings or notification policy if PR comments are expected. The run's trigger details show what event Spacelift received.

24. How do you manage Spacelift itself as code?

Use the Spacelift Terraform provider to define stacks, contexts, policies, integrations and dependencies in Git, often from an administrative stack. New stacks then go through code review like any other infrastructure change.

25. How do you test and publish a reusable module?

Put the module in the Spacelift module registry, add test cases that run plans or applies against example configurations, and publish versions through Git tags. Consumers pin versions so module changes roll out deliberately.

26. A run fails at init with a provider download error. What do you check?

Network access from the worker to the provider registry, proxy settings on private workers, the provider version constraint and the lock file. If private workers have no internet access, use a provider mirror or a private registry.

27. How do you keep secrets out of plan output and logs?

Mark variables and outputs as sensitive in Terraform, store secret values as secret environment variables in contexts or fetch them at run time from a secrets manager, and never print them in hooks. Review who can read run logs through access rules.

28. How would you migrate 50 Terraform workspaces from another platform to Spacelift?

Inventory the workspaces, decide on stack boundaries and naming, and define stacks with the Spacelift Terraform provider. Migrate state per workspace (or point stacks at the existing backend), run a proposed run on each to confirm "no changes", then switch tracked branches and turn off the old runs. Move in batches, starting with non-production.

Senior engineers (29 to 36)

29. How do you design stack boundaries for a large platform?

Split by ownership, change rate and blast radius: networking, shared data stores and application services in separate stacks per environment. Small stacks plan faster and limit damage, but too many stacks create dependency overhead. Make dependencies explicit with stack dependencies and avoid circular ones.

30. How do you enforce tagging and cost controls?

Use a plan policy that denies resources without required tags, and warn on expensive instance types or large counts. Feed cost estimates into plan policies where your setup supports it, and review warnings in pull requests.

31. How do you secure private workers?

Run them in a dedicated network segment with least-privilege access, keep the worker image patched, restrict who can register workers, rotate worker pool credentials, and send logs to your central logging. Treat workers as highly trusted systems because they hold credentials during runs.

32. How do you handle a production drift report?

Find out who changed what and why, using cloud audit logs. If the manual change was an emergency fix that should stay, update the code to match and apply. If it was a mistake, let a tracked run reconcile it. Then fix the access that allowed the change. Turn on automatic reconciliation only where manual changes are never expected.

33. How do you write login policies for SSO?

Map identity provider groups to roles in the login policy: allow members of engineering groups, grant admin only to the platform team's group, and deny everyone else. Explain denials so users know why they cannot log in. Test with sample login input before rollout.

34. How do you test Rego policies?

Write unit tests next to each policy using opa test, with sample input captured from real runs (Spacelift can sample policy inputs). Run the tests in CI on every policy change, and roll out new deny rules as warnings first.

35. Compare Spacelift with Terraform Cloud (HCP Terraform) in an interview.

Both run Terraform remotely with state, policy and approvals. Spacelift supports several IaC tools and uses OPA Rego policies throughout; HCP Terraform is HashiCorp's own service with Sentinel and OPA policy support. Pick based on the tools you run, policy needs, pricing model and whether you need self-hosting. Our post on when to use Terraform Cloud adds context.

36. How do you measure whether the IaC platform is working well?

Track run success rate, time from merge to apply, number of failed applies in production, drift findings per month and policy violations caught before apply. Review them with teams each quarter.

Scenarios (37 to 40)

37. Scenario: a plan wants to replace a production database because of a renamed resource

Answer: do not confirm the run. Add a moved block in the Terraform code that maps the old address to the new one, push, and check the new proposed run shows no replacement. Add a plan policy that denies database deletes so the next mistake is blocked automatically.

38. Scenario: runs are queued for a long time

Answer: check worker pool capacity and whether private workers are healthy and connected. Look for long-running or stuck runs holding workers, and for many stacks triggered at once by a shared change. Add workers, split the trigger, or use push policies to avoid running stacks that did not change.

39. Scenario: a developer applied from their laptop and the state is now out of sync

Answer: lock the stack, compare the state with real infrastructure using a proposed run, and reconcile through Spacelift. Remove direct write access to production state and cloud admin rights from personal accounts, so Spacelift is the only path to apply.

40. Scenario: a new team wants to self-serve environments without filing tickets

Answer: give them a space with approved modules, contexts and policies, and use blueprints or templates so they can create stacks from a standard form. Guardrails come from plan and approval policies, not from manual review of every request.

How to prepare

Create a free Spacelift account if your situation allows, connect a test repository, and build two stacks with a dependency, a context, a cloud integration and a plan policy. Break a run on purpose and read the logs. Strengthen Terraform first with our Terraform training (Kharadi, Pune classroom and live online), and compare IaC tools in our infrastructure as code tools guide. The 200+ DevOps interview questions guide covers the rest of a typical loop.

Frequently asked questions

What topics come up in a Spacelift engineer interview?

Terraform or OpenTofu basics, stacks and runs, contexts, worker pools, stack dependencies, drift detection, cloud integrations and Rego policies. Senior roles add stack design, security of private workers and policy testing.

What policy types does Spacelift support?

The main types are login, access, approval, plan, push, trigger and notification, plus intent policies for Intent projects. Initialization and task policies are deprecated in favor of approval policies.

What is the difference between tracked and proposed runs in Spacelift?

Tracked runs come from the stack's tracked branch and can apply changes. Proposed runs come from pull requests or other branches and only show a plan for review.

Do I need to know Rego for Spacelift interviews?

Yes, at least the basics. You should be able to read and write a simple plan policy that denies or warns on certain resource changes, and explain how policies are attached to stacks.

When should I use private workers in Spacelift?

Use private workers when runs must reach private networks, when credentials and code must stay in your infrastructure, or when compliance rules require it. Public workers are simpler for open cloud APIs.

Does Spacelift only work with Terraform?

No. Spacelift supports Terraform, OpenTofu, Terragrunt, Pulumi, CloudFormation, Kubernetes and Ansible stacks. Check the documentation for the exact versions supported.

Are stack dependencies better than trigger policies?

For most cases, yes. Stack dependencies run stacks in a defined order and pass outputs directly, and Spacelift's docs describe trigger policies as mostly replaced by them.

References

What's Your Reaction?

Like Like 0
Dislike Dislike 0
Love Love 0
Funny Funny 0
Angry Angry 0
Sad Sad 0
Wow Wow 0
Mridul I am a passionate technology enthusiast with a strong focus on DevOps, Cloud Computing, and Cybersecurity. Through my blogs at DevOps Training Institute, I aim to simplify complex concepts and share practical insights for learners and professionals. My goal is to empower readers with knowledge, hands-on tips, and industry best practices to stay ahead in the ever-evolving world of DevOps.