Multiple Runtimes?

I have several lambda functions that I’m trying to consolidate into a single serverless project. Some of the functions are written in python, and others are written in nodejs. Is there a way to define the runtime on a per-function basis to override the runtime defined in the provider section of the yaml? Below is what I’ve tried, but the resulting cloudformaiton template still uses “nodejs4.3”.

Thanks!

EXAMPLE:
service: MultiRuntimeService

provider:
  name: aws
  runtime: nodejs4.3

functions:
  jshello:
    handler: jshandler.hello
    Runtime: nodejs4.3
    
  pyhello:
    handler: pyhandler.hello
    Runtime: python2.7
1 Like

Hey @davidrdark at the moment this is not possible. Could you create an issue in our Github for it. Additionally you can work around it at the moment by overwriting the function through custom resources: https://github.com/serverless/serverless/blob/master/docs/01-guide/06-custom-provider-resources.md

Basically those custom resources get merged on top of the functions we define from the config so you can overwrite things.

1 Like

Thanks for the response @flomotlik ! I’ll give that a try, then submit the issue for this feature.

I attempted to solve this with this PR. It seems to work for me. Let me know if it works for you. @davidrdark @flomotlik