bref/symfony-bridge
Bref runtime bridge for running Symfony on AWS Lambda. Install with Composer, extend BrefKernel in your Kernel, and deploy with a warm cache to reduce cold-start time. Avoid filesystem writes in production.
class Kernel extends BrefKernel) and inherits the work. That makes the "move the monolith to Lambda" roadmap item cheap enough to schedule as an experiment rather than a quarter-long project.BREF_LOOP_MAX configurable) is the lever for deciding how to run: FPM layer for simplicity vs. function runtime for per-request efficiency. That's a pricing-tier decision for your hosting story, not a code decision.handler: App\Service\MyService) instead of a bespoke bin/consumer.php. This unlocks roadmap items like async webhooks, email/report fan-out, image processing, scheduled jobs, and queue-drained integrations without standing up workers or ECS services./tmp, so a warm container accepting uploads would eventually fill its disk and break every other writer to /tmp — logs, temp caches, generated PDFs. That was a latent production failure mode for any roadmap item involving uploads (avatars, CSVs, invoice attachments, bulk imports), and it is now a solved one. The lesson for the roadmap is not "uploads are safe" but "any /tmp usage is a shared, finite budget" — worth a line in the architecture notes.bref/monolog-bridge 2.0 support puts the Lambda invocation request ID on every log line. Correlating a customer complaint to a single request in CloudWatch Insights becomes a support-SLA input rather than a forensic exercise.Adopt when most of the following hold:
bref/laravel-bridge, and framework-agnostic PHP work only needs Bref itself.Kernel, existing bundles, existing public/index.php. If your app already boots cleanly, this is close to a drop-in.var/cache, a plan for cold-start tuning and tracing, and awareness that /tmp is per-instance and small.Look elsewhere, or defer, when:
cache.system or filesystem pools are the wrong pattern; if you cannot remove them, a container runtime (ECS/Fargate) is the honest answer. Large or concurrent file uploads belong in the same conversation: stream to S3 rather than reasoning about /tmp headroom.For executives (one paragraph): This is a small, free, MIT-licensed adapter that lets our existing Symfony application run on AWS Lambda with a one-line code change. It converts a "should we re-platform?" question into a low-risk pilot: no rewrite, no licensing cost, and reversible — rip it out and the app runs as before. The commercial upside is on the cost line (pay-per-request instead of idle servers, especially for low-traffic and spiky products) and on the delivery line (queue and background-job work becomes configuration rather than a new service to operate). The most recent patch is a good illustration of the maintenance model working as intended: a latent disk-exhaustion bug affecting file uploads was found and fixed in days, at the cost of a version bump — community-supported, but actively watched. The risk remains concentrated and knowable: small code surface, maintained by Bref's own author, with a defined exit to containers if it disappoints.
For engineering leadership: The change is Kernel extends BrefKernel; the rest is convention. Three things become deploy-time responsibilities rather than runtime behavior: run cache:clear --env=prod and composer install --classmap-authoritative in the pipeline so the first request isn't paying 1–20 seconds of cache build, disable Dotenv with a generated .env.local.php, and stop writing to filesystem cache pools (return [] from getWritableCacheDirectories() to symlink pools). Optional upside: switch off PHP-FPM and let the kept-alive Symfony process handle requests with BREF_LOOP_MAX as a recycle cap, and register services as public if you want SQS/Messenger handlers addressed by class name. Logs come out CloudWatch-ready with the Lambda request ID, which materially shortens incident triage.
What changed in 3.0.3, and why it matters to the plan: on the Bref runtime, uploaded request files were never deleted from the instance's /tmp, so warm containers slowly filled their disk and then failed everywhere that touches /tmp. 3.0.3 deletes them at the start of the next request — which is the right fix, but it means peak /tmp usage is one request's worth of uploads plus whatever else the app writes there, not zero. It also requires Bref ≥ 3.0.13; on PHP 8.4+ earlier Bref versions missed the cleanup entirely. Concretely: pin Bref, check the resolved version in composer.lock rather than the constraint, and if you take large uploads, put a hard limit on request body size and consider streaming straight to S3.
Risks to name up front, and the mitigations:
kernel.php bootstrap returning the kernel; the README shows exactly how)./tmp as a shared, invisible budget → it is per-instance, small, and shared between uploads, logs, and temp files. Any feature that writes there inherits the failure mode this release just fixed. Add a size cap on uploads and a smoke test, rather than trusting it stays quiet.Recommendation: Approve a bounded pilot on one low-risk, spiky or queue-heavy Symfony service. Success criteria: unchanged application code beyond the kernel base class, p95 latency within an agreed envelope of current hosting, no filesystem cache writes, /tmp stable across repeated upload requests, request-ID-correlated logs in CloudWatch, and a written exit plan to Fargate. Revisit the full portfolio migration only after those hold.
How can I help you explore Laravel packages today?