Symfony dev containers: why `alias:` beats `class:` for local S3 service mocking
A Symfony 5.3 import pipeline writing to AWS S3 posed a local testing challenge, as ECS-based credentials and bucket parameters are unavailable outside production. The developer evaluated two approaches: spinning up a MinIO container or building a disposable fake S3 service redirecting operations to the local filesystem. A lightweight fake service was preferred, wired in via a non-committed `when@dev` block — the smallest reversible change possible. During implementation, using `class:` to override the service definition failed, while `alias:` worked correctly by redirecting the service identifier to the fake implementation. The article argues this choice between MinIO and a homemade double is ultimately a matter of context, not capability.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.


Discussion (0)
Log in to join the discussion and vote.
Log in