Skip to main content

Clone stack mechanism

It would be really useful to have an endpoint for cloning a stack. We’d like to use it to spin up stacks for feature branches, and having this available through the API would make that workflow much smoother. From a technical perspective, it should be pretty straightforward to implement.

Workaround
Problem
Status: ❌ Rejected1 comment

Log in to comment and vote

Comments1

  • Black Breeze

    •

    Dec 5, 2025

    Thanks for the detailed feedback on your feature branch workflow. I understand the appeal of a clone endpoint for spinning up temporary stacks quickly.This workflow is already achievable using Spacelift's existing capabilities, and I'd recommend exploring these approaches which offer better long-term maintainability:

    Option 1: Spacelift Blueprints

    Create a Blueprint template that captures your stack configuration with the VPC name as a variable. This gives you a reusable template specifically designed for creating consistent stacks with variations.

    Option 2: OpenTofu/Terraform Provider

    Define your feature branch stacks as code using our provider. This makes your infrastructure definitions version-controlled and auditable:

    resource "spacelift_stack" "feature_branch" {
      name = "my-stack-${var.branch_name}"
      repository = "my-repo"
      branch = var.branch_name
      # ... other configuration
    }

    Option 3: API Automation

    Build a small script that uses our GraphQL API to fetch your template stack's configuration and create new ones programmatically. This gives you the automation you want while keeping the process explicit.

    These approaches align better with infrastructure-as-code principles by keeping your stack definitions in version control rather than creating implicit copies.