Q: AWS Cloudformation and Lambda functions - how to handle lambdas code and deployment? Given a cloudformation template/stack for my app architecture I do need now to add some (backend) business logic with a lambda function.
Which is the best way to handle the code considering repositories and deployment pipelines?
I mean:

*

*using an AWS::Serverless::Function with AWS SAM cli, thus having both backend infrastructure and buiness logic bounded togheter in the same repository?

*using an AWS::Lambda::Function with plain AWS cli and a different repository just for the lambda code?

First option gives ease of maintenance and deployment, but the second one gives more security speaking of permissions (looking towards at a more complex stack with more functions) due separating business logic and architecture repositories.
Moreover, having a repository just for the function means that time for tests is not added to the time for stack deployment/update, thus having faster pipelines.
