This enables you to, with a little more effort, swap out the Interface Adapter part with, say, a CLI. Or, if you ever want to get off lambda, its a bit easier as well.
Mocking out dependencies, like S3 buckets, isn't worth it during a prototype/MVP. As time goes on, sure, go for it. But early on, just use AWS. Don't use localstack or any of the other various tools that try to replicate AWS. They're all going to get it wrong, hopefully in obvious ways, but usually in subtle ways that'll crash production, and you're just creating more work for yourself. Just use AWS. Just use AWS. Just use AWS.
Then, everything is once more tested using AWS. I stay away from replicating AWS services locally.
It greatly simplifies refactoring and overhauling the core itself, as well as trying out new approaches.
And local development when you've opted to use systems like Cognito are well beyond its scope, unless someone has something very clever that I haven't seen.
From a lot of experience doing this on AWS and on other clouds, I have learned that it is better to use systems that you can operate, and then use hosted versions where applicable. RDS is great, but it's great mostly because you can run PostgreSQL locally and inspect its brain. DynamoDB, SQS, etc. tend to be untrustworthy and should be avoided unless you have a bulletproof story for local testing (and none of the fake implementations are bulletproof).
(I actually have an answer for local dev with Cognito because my current employer already had Cognito when I showed up, but it amounts to "have configurable signing keys and sign your own JWT in dev".)
Our local tests' leaky abstractions don't care about anything happening upstream. They only care about testing our core "agnostic" logic.
It's easy. But if that's too much for you, the serverless framework has some nice plugins for all of it.