0

I have followed the guide in https://aws.amazon.com/blogs/compute/introducing-the-c-lambda-runtime/ to package my c++ lambda function into a zip file. The zip file has the contents: function.zip bin function lib many .so files, etc. bootstrap

In the guide the lambda is deployed using the aws lambda create-function with the handler specified to be the same as the zip file name.

I would like to configure this lambda function in my serverless.yml and deploy it with the rest of my lambdas. I am not sure what the handler field below should be and using the zip file name didn't work out.

functions:  
  function:
    runtime: provided
    package:
      include: 
        - function.zip
    handler: function 
    events:
      - http:
          path: function
          method: get
          cors: true
          authorizer: aws_iam

When I run serverless deploy -v I get warnings like:

Serverless: WARNING: Entry for function@function could not be retrieved. Please check your service config if you want to use lib.entries.

0

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, & 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.

  • I used a different name than "function". I have no knowledge of Gitlab CI/CD... but I will see if it can help – fadiak Apr 21 at 13:18

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.