Add LocalStack deployment for local E2E testing#77
Merged
Conversation
Adds deploy/localstack/ so the full Interlock stack can be smoke-tested against LocalStack Community without an AWS account. - build.sh builds all 6 Lambda handlers for the host arch (arm64/amd64) as linux bootstrap binaries under deploy/localstack/dist/ - deploy.py (boto3) provisions IAM roles, 4 DynamoDB tables with streams, SQS alerts queue, EventBridge bus + rules, all 6 Lambdas, Step Functions state machine, and event source mappings. Mirrors the Terraform shape. - Makefile wires localstack-up/build/deploy/smoke/teardown targets. - README documents the quick-start, what's skipped vs production (EventBridge Scheduler is Pro-only, CloudWatch alarms, KMS SQS), and the verification smoke test. To handle the Pro-only EventBridge Scheduler dependency, introduces a SKIP_SCHEDULER env var guard: - lambda.SkipScheduler() helper reads SKIP_SCHEDULER=true once per call. - Applied at every scheduler.CreateSchedule / DeleteSchedule site: sla_monitor.go (handleSLASchedule, handleSLACancel, createOneTimeSchedule) sla/cancel.go, sla/schedule.go (sub-package mirrors) watchdog_sla.go, watchdog/sla.go (proactive scheduling entry points) - When set, scheduler calls are no-op'd and logged; the rest of the SLA logic (calculation, cancellation verdict, event publish) runs unchanged so LocalStack smoke tests exercise the full handler flow. - deploy.py sets SKIP_SCHEDULER=true only on the sla-monitor Lambda so production Lambdas are unaffected. Also ignores deploy/localstack/dist/ (build artifacts, ~124MB of zips). Tests: go build ./... and go test -race ./... both pass unchanged.
Build script auto-detects host architecture and builds all six Go Lambdas as distroless zip packages. Python boto3 deployer creates DynamoDB tables with streams, EventBridge custom bus with routing rules, SQS alert queue, IAM roles, event source mappings, and the Step Functions state machine, matching the production Terraform resource shape. Lambda containers run on a dedicated Docker network to reach LocalStack by service name. SLA monitor env var guard no-ops EventBridge Scheduler calls when SKIP_SCHEDULER is set, preserving the production code path while enabling deployment to LocalStack Community (where Scheduler is a Pro-only service).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds
deploy/localstack/with build + deploy scripts that run the full Interlock stack against LocalStack Community:What's skipped
EventBridge Scheduler (LocalStack Pro only). The
sla-monitorLambda no-ops scheduler API calls whenSKIP_SCHEDULER=true; all other SLA logic (deadline calculation, event publishing) runs normally.Usage