serverless-webpack icon indicating copy to clipboard operation
serverless-webpack copied to clipboard

"individually" flag in function definition is ignored

Open deftomat opened this issue 6 years ago • 5 comments

This is a Bug Report

Description

Using individually: true in function definition is ignored.

According to serverless docs, you can add individually flag on per-function basis.

functions:
  myFunction:
    handler: myFunction.handler
    package:
      individually: true

Unfortunately, this flag is ignored by this plugin. I will happily create a PR but your guidance could really help.

Additional Data

  • Serverless-Webpack Version you're using: 5.2.0
  • Serverless Framework Version you're using: 1.32.0"

deftomat avatar Nov 15 '18 07:11 deftomat

@HyperBrain is this currently possible at all? I was under the impression you could either have all your functions packaged into one ZIP, or each function separately packaged, but not a mixture of both?

hassankhan avatar Apr 24 '19 19:04 hassankhan

@hassankhan @deftomat Yes, that's right. The plugin checks the global package setting and either packages all functions separately or as one service zip. In general, there should not be any need to create a mixed output.

HyperBrain avatar Apr 24 '19 21:04 HyperBrain

Thanks for confirming that, @HyperBrain 👍.

@deftomat is there a use-case you had in mind?

hassankhan avatar Apr 25 '19 23:04 hassankhan

@hassankhan

I have a use-case.
There's a log forwarding lambda, which I'd like to have deployed alongside each of my services.
I'd like that to be included in each of the services so I may pass custom metadata to that log forwarding lambda configuration in each service.

This lambda isn't my package, but a dependency and is written in Python.
As such, I'd like this lambda alone to be packaged separately.

  logzio:
    package:
      individually: true
    runtime: python3.6
    handler: functions/logzio.lambda_handler
    logForwarding:
      enabled: false

roni-frantchi avatar Feb 13 '20 11:02 roni-frantchi

Missing this feature as well. My AWS cognito trigger functions are small and need to be quick. Rest of functions share same large dependencies and should be in one package.

filipsuk avatar May 05 '20 10:05 filipsuk