Spacelift · Capability

Spacelift Infrastructure Orchestration

Workflow capability for orchestrating infrastructure deployments through Spacelift. Enables platform engineers and DevOps teams to manage IaC stacks, trigger deployments, enforce governance policies, and monitor worker pool health programmatically.

Run with Naftiko Infrastructure as CodeDevOpsPlatform EngineeringTerraformGitOps

What You Can Do

GET
List stacks — List all infrastructure stacks with state and configuration
/v1/stacks
POST
Create stack — Create a new infrastructure stack
/v1/stacks
POST
Create run — Trigger a new deployment run on a stack
/v1/runs
GET
List policies — List all governance policies in the account
/v1/policies
GET
List contexts — List all shared contexts available for stack attachment
/v1/contexts
GET
List worker pools — List all worker pools and their current worker status
/v1/worker-pools

MCP Tools

list-stacks

List all Spacelift infrastructure stacks with their current state, repository, and deployment configuration

read-only
create-stack

Create a new infrastructure stack in Spacelift connected to a source repository

trigger-run

Trigger a new infrastructure deployment run on a Spacelift stack

list-policies

List all governance policies (OPA/Rego) enforcing infrastructure deployment rules

read-only
list-contexts

List all shared contexts containing environment variables and files for stacks

read-only
list-worker-pools

List all worker pools and their worker health status

read-only

APIs Used

spacelift

Capability Spec

infrastructure-orchestration.yaml Raw ↑
naftiko: "1.0.0-alpha1"

info:
  label: Spacelift Infrastructure Orchestration
  description: >-
    Workflow capability for orchestrating infrastructure deployments through Spacelift.
    Enables platform engineers and DevOps teams to manage IaC stacks, trigger deployments,
    enforce governance policies, and monitor worker pool health programmatically.
  tags:
    - Infrastructure as Code
    - DevOps
    - Platform Engineering
    - Terraform
    - GitOps
  created: "2026-05-02"
  modified: "2026-05-02"

binds:
  - namespace: env
    keys:
      SPACELIFT_API_KEY_ID: SPACELIFT_API_KEY_ID
      SPACELIFT_API_KEY_SECRET: SPACELIFT_API_KEY_SECRET
      SPACELIFT_ACCOUNT: SPACELIFT_ACCOUNT

capability:
  consumes:
    - import: spacelift
      location: ./shared/spacelift.yaml

  exposes:
    - type: rest
      port: 8080
      namespace: spacelift-orchestration-api
      description: Unified REST API for infrastructure orchestration via Spacelift.
      resources:
        - path: /v1/stacks
          name: stacks
          description: Infrastructure stacks managed by Spacelift
          operations:
            - method: GET
              name: list-stacks
              description: List all infrastructure stacks with state and configuration
              call: "spacelift.list-stacks"
              outputParameters:
                - type: object
                  mapping: "$.data.stacks"
            - method: POST
              name: create-stack
              description: Create a new infrastructure stack
              call: "spacelift.create-stack"
              with:
                input: "rest.body"
              outputParameters:
                - type: object
                  mapping: "$.data.stackCreate"
        - path: /v1/runs
          name: runs
          description: Infrastructure deployment runs
          operations:
            - method: POST
              name: create-run
              description: Trigger a new deployment run on a stack
              call: "spacelift.create-run"
              with:
                stack: "rest.stack"
                message: "rest.message"
              outputParameters:
                - type: object
                  mapping: "$.data.runCreate"
        - path: /v1/policies
          name: policies
          description: Governance policies (OPA/Rego)
          operations:
            - method: GET
              name: list-policies
              description: List all governance policies in the account
              call: "spacelift.list-policies"
              outputParameters:
                - type: object
                  mapping: "$.data.policies"
        - path: /v1/contexts
          name: contexts
          description: Shared environment variable contexts
          operations:
            - method: GET
              name: list-contexts
              description: List all shared contexts available for stack attachment
              call: "spacelift.list-contexts"
              outputParameters:
                - type: object
                  mapping: "$.data.contexts"
        - path: /v1/worker-pools
          name: worker-pools
          description: Worker pools for running infrastructure jobs
          operations:
            - method: GET
              name: list-worker-pools
              description: List all worker pools and their current worker status
              call: "spacelift.list-worker-pools"
              outputParameters:
                - type: object
                  mapping: "$.data.workerPools"

    - type: mcp
      port: 9090
      namespace: spacelift-orchestration-mcp
      transport: http
      description: MCP server for AI-assisted infrastructure orchestration via Spacelift.
      tools:
        - name: list-stacks
          description: List all Spacelift infrastructure stacks with their current state, repository, and deployment configuration
          hints:
            readOnly: true
          call: "spacelift.list-stacks"
          outputParameters:
            - type: object
              mapping: "$.data.stacks"
        - name: create-stack
          description: Create a new infrastructure stack in Spacelift connected to a source repository
          hints:
            readOnly: false
          call: "spacelift.create-stack"
          with:
            input: "tools.input"
          outputParameters:
            - type: object
              mapping: "$.data.stackCreate"
        - name: trigger-run
          description: Trigger a new infrastructure deployment run on a Spacelift stack
          hints:
            readOnly: false
          call: "spacelift.create-run"
          with:
            stack: "tools.stack"
            message: "tools.message"
          outputParameters:
            - type: object
              mapping: "$.data.runCreate"
        - name: list-policies
          description: List all governance policies (OPA/Rego) enforcing infrastructure deployment rules
          hints:
            readOnly: true
          call: "spacelift.list-policies"
          outputParameters:
            - type: object
              mapping: "$.data.policies"
        - name: list-contexts
          description: List all shared contexts containing environment variables and files for stacks
          hints:
            readOnly: true
          call: "spacelift.list-contexts"
          outputParameters:
            - type: object
              mapping: "$.data.contexts"
        - name: list-worker-pools
          description: List all worker pools and their worker health status
          hints:
            readOnly: true
          call: "spacelift.list-worker-pools"
          outputParameters:
            - type: object
              mapping: "$.data.workerPools"