This directory contains starter templates for creating new services that deploy via Knife-Drop.
Run the bootstrap script from the knife-drop repo root:
./bootstrap-service.pyThe script clones templates from pattern/knife-drop-templates and asks you:
- Service name
- Language (python/node/go/loki)
- Account to deploy to
- Output directory
It creates a complete service repository with:
- Dockerfile
- Sample application code with
/and/healthendpoints - GitHub Action for CI/CD
- README with instructions
- .gitignore
- Flask web server
- Port 8080
- requirements.txt for dependencies
- Express web server
- Port 8080
- package.json for dependencies
- Standard library HTTP server
- Port 8080
- Multi-stage Docker build
- Minimal Python web form; on submit, logs input to stdout (one JSON line).
- Used with
enable_loki_logging: truein knife-drop so the Fluent Bit sidecar sends logs to Loki. - Port 8080; no Loki client in the app—just
print()to stdout. - Service JSON includes
enable_gatekeeper: trueandenable_loki_logging: true; deploy to an account that has Loki SSM parameters andCommonECSLokiTaskExecPolicy.
The generated workflow uses OIDC authentication (no access keys needed):
- Builds Docker image on push to main/develop
- Pushes to ECR with commit SHA and
latesttags - Forces ECS service redeployment
The IAM role GitHubActionsECRDeploy is created by Terraform and trusts GitHub OIDC for pattern/* repos.
After generation, you can:
- Modify the application code in
src/ - Update the Dockerfile
- Add dependencies
- Customize the GitHub Action workflow
- Add environment variables to the service JSON
After creating a service:
- Initialize git repo
- Create GitHub repository under
patternorg - Create service JSON in
knife-drop/accounts/sandbox/services/ - Run
terraform applyto create infrastructure - Push code to trigger deployment