Serverless framework: how to specify a c++ lambda function with provided deployment package
I don't see any documentation from serverless.com that they support C and C++ (while AWS Lambda might do), I have asked about it now so that we can know:

https://forum.serverless.com/t/c-and-c-support/8045

("Supports Node.js, Python, Java, Go, C#, Ruby, Swift, Kotlin, PHP, Scala, &amp; F#") but if you want to try then I think that you should try some other name than "function" for your function. I did not try this at home but all examples use some other name than "function" because that word might be reserved. 

https://serverless.com/framework/docs/providers/aws/guide/resources/ 

If that still won't work, check your path to your code and maybe you also want to set up everything up with a CI/CD pipeline with GitLab for example. That's how I do it.