50 Spacelift Interview Questions and Answers (2027)
50 Spacelift interview questions on stacks, vendors, spaces, contexts, blueprints, module registry, OIDC and private workers, with direct answers.
Spacelift interview questions check whether you can run infrastructure as code through a governed platform: stacks for Terraform, OpenTofu, Pulumi, CloudFormation, Kubernetes, Ansible and Terragrunt, Rego policies, contexts, spaces, blueprints, the module registry, OIDC credentials and private workers. This page has 50 questions with direct answers, grouped by level, plus scenarios.
Answers were checked against the Spacelift documentation in November 2026, including recent changes such as the deprecated administrative flag and the planned MQTT sunset for private workers. This set focuses on platform features beyond the core Terraform workflow. For questions on runs, approvals and plan policy writing, see our companion post on Spacelift engineer interview questions, which covers those areas in depth.
Key takeaways
- Know the vendors a stack can run and when you would pick each one.
- Expect questions on spaces, inheritance and login policies, because they decide who can change what.
- Contexts, auto-attach labels and their precedence order come up often in mid-level interviews.
- Senior candidates should explain OIDC claims and scopes, managing Spacelift with its own Terraform provider, and blueprint-based self-service.
- Recent changes matter: the administrative flag is replaced by role attachments, several policy types are deprecated, and MQTT for private workers is scheduled for sunset on 30 March 2027.
Spacelift building blocks at a glance
| Concept | What it is | Interview angle |
|---|---|---|
| Stack | Repository, branch, project root, vendor, settings and state | How to split stacks in a monorepo |
| Context | Shared variables, files and hooks | Auto-attach labels and precedence |
| Space | Folder in an access tree that holds resources | Delegation and inheritance |
| Policy | Rego rules evaluated by OPA | Which types are current, how to test them |
| Blueprint | YAML template that creates configured stacks | Self-service with guardrails |
| Module registry | Private, versioned, tested modules | Versioning through config.yml |
| Worker pool | Where runs execute, public or private | Security, drift detection, network access |
| spacectl | Command-line client for the API | Automation from CI |
If you are newer to infrastructure as code itself, read our pillar post on infrastructure as code tools for DevOps before these questions.
Fundamentals (1 to 18)
1. What problem does Spacelift solve in an infrastructure as code workflow?
Spacelift is a platform for running infrastructure as code. It connects to your Git repository, runs plans on pull requests, applies approved changes, enforces policies written in Rego and keeps an audit trail. It replaces scripts in a generic CI system with a workflow built around state, approvals and drift.
2. Which IaC tools can a Spacelift stack run?
The Spacelift documentation lists Terraform, OpenTofu, Pulumi, AWS CloudFormation, Kubernetes, Ansible and Terragrunt as supported vendors. The vendor is set per stack, so one Spacelift account can manage Terraform networking and Ansible configuration side by side.
3. What is a stack in Spacelift?
A stack combines a source repository and branch, a project root, a vendor, settings, environment and state. It is the unit Spacelift plans and applies. A stack's state generally reflects its most recent tracked run, or None if nothing has run yet.
4. What is the project root setting used for?
It sets the directory inside the repository where the stack's code starts. In a monorepo, each stack points at its own folder, such as environments/prod/network, so stacks do not run each other's code.
5. What are project globs?
Extra paths outside the project root that should trigger runs when they change, for example a shared modules folder. They only affect triggering; Spacelift does not mount those files into the workspace because of the glob.
6. What is the difference between a proposed run and a tracked run?
A proposed run plans changes from a pull request or non-tracked branch and never applies. A tracked run comes from the tracked branch and can apply after confirmation or automatically. Spacelift also has tasks for one-off commands and test runs for modules.
7. What does autodeploy do?
With autodeploy on, a tracked run applies automatically when planning succeeds and no plan policy warnings are raised. With it off, a person must confirm the run before it applies. Production stacks usually keep it off or rely on approval policies.
8. What is a context?
A reusable bundle of environment variables, mounted files and hooks that can be attached to many stacks or modules. Secret values in a context are hidden in the UI and API. Changes to a context apply to every project it is attached to.
9. How does auto-attaching a context work?
Add a label such as autoattach:prod to the context, and every stack with the label prod receives it. The label autoattach:* attaches it to all projects in the context's space and its child spaces.
10. In what order are environment values applied when several sources define the same variable?
Stack-level settings take precedence, then manually attached contexts in order of their priority number (lower first), then auto-attached contexts in alphabetical order. Auto-attached contexts have no priority setting.
11. What are spaces?
Spaces are folders in a tree, starting at the root space, that hold stacks, policies, contexts, modules, worker pools and cloud integrations. They let you delegate admin rights for part of the account. Every account also has a legacy space for older access settings.
12. How does inheritance between spaces work?
A child space can use resources from its parent when inheritance is on. Policies labelled autoattach:* apply to stacks in every space that inherits from the policy's space, and stack role attachments propagate down to child spaces.
13. What language are Spacelift policies written in?
Rego, evaluated by Open Policy Agent. Spacelift supports both Rego v0 and v1 syntax and recommends v1 for new policies.
14. Which policy types are current, and which are deprecated?
Current types include login, approval, plan, push, notification and intent policies. Access policies have been replaced by space access control, the server-side initialization and task policies are deprecated, and trigger policies are mostly replaced by stack dependencies.
15. What are worker pools?
Workers execute runs. The public pool is hosted and maintained by Spacelift. A private pool runs on your own infrastructure, which gives you control over network access, images and private registries, in exchange for maintaining the compute.
16. What is spacectl?
The Spacelift command-line tool. It wraps the GraphQL API so you can log in with spacectl profile login, list stacks, trigger deployments with spacectl stack deploy and fetch module registry credentials, from a terminal or a CI pipeline.
17. What are hooks?
Commands that run before or after phases such as init, plan or apply. They can come from stack settings or from attached contexts and run in the order listed. Common uses are installing a tool, running a linter or exporting a value.
18. What is the runner image setting?
The container image a run executes in. You can replace the default with your own image that has pinned versions of tools such as tflint, checkov or a cloud CLI, so every run uses the same environment.
Intermediate (19 to 36)
19. How does Spacelift's private module registry version modules?
Versions come from the module_version field in .spacelift/config.yml, not from Git tags. A version is created when tests pass on a tracked change, numbers must follow semantic versioning in sequence, and a successful number cannot be reused.
20. How are module test cases defined?
Under tests in .spacelift/config.yml. Each case has a name and can set its own project root, Terraform version and environment. A test runs init, plan and apply, then destroys what it created. Marking a case negative: true means it is expected to fail.
21. How do you consume a Spacelift module from a stack?
Reference it with the source format spacelift.io/organization/module_name/provider and a version constraint. Modules shared to a space are available to stacks in that space. Outside Spacelift, terraform login spacelift.io or spacectl registry credentials gives access.
22. What is a blueprint?
A YAML template with inputs that creates a fully configured stack, including vendor, VCS settings, environment, attached contexts and policies, schedules and dependencies. Stacks created from one are independent of later blueprint changes.
23. What happens when you publish a blueprint?
Spacelift checks that required fields such as name, space, vcs and vendor are present, and the blueprint can then be used and shared by link. A published blueprint cannot return to draft; to change it you clone, edit and publish the copy.
24. Which input types can a blueprint define?
short_text (the default), long_text, secret, number, boolean, select with a list of options, and float. Inputs are referenced as ${{ inputs.id }} and expressions use Google CEL.
25. How does drift detection work in Spacelift?
You add a schedule with cron rules to a stack. Spacelift runs proposed runs in the background against the stack's last finished state and reports changes. Drift detection only works on private workers.
26. What does the reconcile option do in drift detection?
When drift is found, reconcile starts a normal tracked run that follows the stack's usual rules, including autodeploy and plan policies. Without it, drifted resources still show in the Resources view and drift jobs are marked in webhook payloads.
27. How does Spacelift OIDC work with cloud providers?
Each run receives a signed token, valid for one hour, in the SPACELIFT_OIDC_TOKEN variable. You configure AWS, Azure, Google Cloud or Vault to trust Spacelift as an identity provider and exchange the token for short-lived credentials, so no static keys are stored.
28. How do OIDC scopes limit what a run can do?
Proposed runs get the read scope; tracked runs, tests, destroys and tasks get write. On stacks without autodeploy, tracked runs get read during planning and write only when applying. Cloud-side trust policies should check these claims.
29. What claims can a cloud trust policy check in the Spacelift token?
Standard claims such as iss, sub and aud, plus custom claims including spaceId, spacePath, callerType, callerId, runType, runId and scope. The default sub value combines space, caller, run type and scope, and its format can be customised.
30. How do you set up a private worker pool?
Generate a private key and certificate signing request with openssl, create the pool in Spacelift and upload the CSR, then store the returned base64 token. Workers start with the token and the private key. Resetting the pool issues a new token and cuts off workers using the old one.
31. How should private worker communication be configured?
SPACELIFT_WORKER_COMMS_PROTOCOL selects mqtt or poll (HTTP long-poll). The documentation says MQTT is scheduled for sunset on 30 March 2027 and recommends switching to poll, so new pools should start with poll.
32. What does enable local preview do, and what is the risk?
It lets users with write access start proposed runs from a local workspace with spacectl stack local-preview. Those runs use the stack's environment variables, so anyone with write access could run arbitrary code with those credentials. Enable it only where that is acceptable.
33. What is well-known secret masking?
A stack setting that redacts recognised secret patterns, such as AWS access keys and GitHub tokens, from run logs. It is a safety net; secrets should still be marked secret in contexts and kept out of outputs.
34. How do you run Ansible with Spacelift?
Create a stack with the Ansible vendor pointing at the playbook in the repository, attach a context with inventory and SSH settings, and run it on a worker pool that can reach the hosts. A common pattern is a Terraform stack creating servers and a dependent Ansible stack configuring them.
35. How do you manage Kubernetes manifests with a Spacelift stack?
Use the Kubernetes vendor, point the stack at the manifest directory and give the run credentials for the target cluster. Proposed runs show the planned changes on pull requests, and tracked runs apply them.
36. Why use Terragrunt stacks in Spacelift?
Teams with existing Terragrunt layouts can keep their DRY configuration and still get Spacelift's pull request plans, policies and approvals, instead of rewriting everything as plain Terraform stacks.
Advanced (37 to 46)
37. What replaced the administrative stack flag?
The administrative flag is deprecated and setting it now does nothing. Spacelift replaced it with role attachments: give a stack the Space Admin role on a space to let it manage Spacelift resources there, with finer permissions and better audit data.
38. How do you manage Spacelift itself as code?
Use the Spacelift Terraform provider in a management stack to define spaces, stacks, contexts, policies, worker pools and integrations. Give that stack a role attachment on the spaces it manages, and protect it with approval policies because it controls everything else.
39. What are intent policies?
Policies that control which resource operations are allowed in Spacelift Intent projects and Infra Assistant Build mode. They let platform teams set limits on AI-assisted or intent-driven changes using the same Rego approach as other policies.
40. How do you test Rego policies before attaching them?
Write unit tests in Rego with sample inputs captured from real runs, run them with the opa test command in CI, and use the policy workbench, which captures evaluation events when a policy's sample rule returns true, to adjust the policy against real inputs. Start new policies as warnings before switching them to deny.
41. How would you organise spaces for a company with several business units?
Create a space per business unit under root, with child spaces for environments such as dev and prod. Put shared modules, base contexts and organisation-wide policies high in the tree, and team-specific stacks and worker pools lower, mapping login policies to identity provider groups.
42. How do login policies map identity provider groups to access?
A login policy is Rego that reads the user's identity provider claims, such as team membership, and grants read, write or admin on specific spaces. For example, members of an R&D group could receive write access to an R&D space only.
43. How do you keep provider credentials scoped per environment?
Use separate OIDC trust relationships or cloud integrations per space or environment, with cloud-side policies that check spacePath or the stack in the token claims. A development stack should never be able to assume a production role.
44. How would you migrate many Terraform workspaces into Spacelift?
Inventory workspaces, create stacks with the Spacelift Terraform provider or blueprints, import existing state into each stack, run proposed runs to confirm zero changes, then switch pipelines off one environment at a time. Keep the old system read-only until every stack is verified.
45. How do you control run concurrency and queue time?
Size private worker pools for peak load, split very large stacks so runs are shorter, avoid triggering many stacks from shared folders without need, and use stack dependencies so downstream stacks wait for their upstream stacks instead of running in parallel.
46. How do you enforce cost or tagging rules in plans?
Write a plan policy that reads the planned resource changes and warns or denies when required tags are missing or when expensive instance types appear. Some teams also feed cost estimates into the plan input and set thresholds.
Scenarios (47 to 50)
47. A drift report shows a security group rule added in the console. What do you do?
Find who made the change from the cloud audit log, decide whether it should stay, and either add it to code through a pull request or let a reconcile run remove it. Then tighten console permissions so changes go through the stack.
48. Private workers stopped picking up runs after a network change. How do you troubleshoot?
Check worker logs for connection errors, confirm outbound access to Spacelift endpoints through the new firewall or proxy, verify the pool token and key are still valid, and confirm which comms protocol the workers use. Moving from MQTT to poll can also simplify firewall rules.
49. A team wants a new service environment without waiting for the platform team. How do you design it?
Publish a blueprint that creates the stack in the team's space with approved contexts, OIDC integration, policies and a drift schedule. The team fills in inputs, and guardrails come from the attached policies rather than manual review.
50. A plan policy suddenly denies every run after someone edited it. How do you fix it?
Turn on the sample rule so the policy workbench captures inputs, replay a recent run's input to find the rule that fires, then fix it with a unit test run through opa test. Roll the corrected version out as a warning first, and require review for policy changes in future.
Example: a context and a module config
Interviewers sometimes ask you to sketch configuration. Below is a minimal .spacelift/config.yml for a module with one test case, using the fields described in the module registry documentation.
version: 1
module_version: 1.4.0
tests:
- name: default settings
project_root: examples/basic
- name: rejects empty name
project_root: examples/invalid
negative: true
You can also add a test_defaults block for shared settings such as the tool version; check which Terraform and OpenTofu versions your account supports before you pin one.
How to prepare
- Use a Spacelift trial or practice account and connect a small Git repository with two stacks: one for networking and one for an application.
- Add a context with an auto-attach label and confirm which stacks receive it.
- Write a plan policy and a login policy in Rego v1, with unit tests run through
opa test. - Publish one module to the private registry with a test case, then consume it from a stack.
- Read the deprecation notes in the policy and stack settings documentation, because interviewers like to check that you are current.
Spacelift sits on top of Terraform skills, so make sure the basics are solid. Our Terraform interview questions and advanced Terraform questions cover state, modules and providers, and Terraform production best practices explains the habits interviewers look for. Our Terraform training runs in Kharadi, Pune and live online across India.
Frequently asked questions
Which tools does Spacelift support besides Terraform?
The documentation lists OpenTofu, Pulumi, AWS CloudFormation, Kubernetes, Ansible and Terragrunt in addition to Terraform.
What are Spacelift spaces used for?
Spaces organise stacks, policies, contexts, modules, worker pools and integrations in a tree, so you can delegate access to part of the account and share resources through inheritance.
How are Spacelift module versions created?
From the module_version field in .spacelift/config.yml. A version is published when tests pass on a tracked change, and numbers must follow semantic versioning in order.
Is the administrative stack setting still used?
No. It is deprecated and has no effect. Use stack role attachments, such as the Space Admin role on a space, instead.
Does drift detection work on public workers?
No. Spacelift drift detection only works on private worker pools.
How do Spacelift runs get cloud credentials without static keys?
Through OIDC. Each run gets a signed token valid for one hour that cloud providers can exchange for short-lived credentials, with claims such as space and scope available to trust policies.
What is the difference between this page and other Spacelift interview guides?
This page focuses on platform features: vendors, spaces, contexts, blueprints, the registry, OIDC and workers. Our Spacelift engineer guide goes deeper on runs, approvals and policy writing.
References
What's Your Reaction?
Like
0
Dislike
0
Love
0
Funny
0
Angry
0
Sad
0
Wow
0