Add EC2 Launch Template strain genesis for AWS horizontal scale.

Ship POST /api/v1/forge/launch-template with cloud-init user-data embedding genesis snapshot hash and strain card ID; first template-tagged auth pins SpreadGeneration=0 and ParentAgentID=template.
This commit is contained in:
AetherForge
2026-06-07 09:57:11 -07:00
parent 7d15888ab0
commit 7191bda6fd
12 changed files with 462 additions and 0 deletions

View File

@@ -0,0 +1,24 @@
package builder
import (
"encoding/json"
"net/http"
)
func (h *Handler) ServeLaunchTemplate(w http.ResponseWriter, r *http.Request) {
if r.Method != http.MethodPost {
http.Error(w, "Method not allowed", http.StatusMethodNotAllowed)
return
}
var req LaunchTemplateRequest
if err := json.NewDecoder(r.Body).Decode(&req); err != nil {
writeJSON(w, http.StatusBadRequest, LaunchTemplateResponse{Success: false, Error: "invalid JSON"})
return
}
resp, err := BuildLaunchTemplateArtifacts(req)
if err != nil {
writeJSON(w, http.StatusBadRequest, resp)
return
}
writeJSON(w, http.StatusOK, resp)
}