serverless-google-cloudfunctions icon indicating copy to clipboard operation
serverless-google-cloudfunctions copied to clipboard

Custom name for Google Cloud Function

Open peric opened this issue 5 years ago • 4 comments

Custom name for Google cloud functions

Description

For AWS lambda, it is possible to set custom name for a Lambda function (https://serverless.com/framework/docs/providers/aws/guide/functions/, line 14 in the example).

I want to be able to do the same with google provider, where config will look something like this:

functions:
  handler:
    handler: Handler
    name: BackupHandler
    memorySize: 256
    timeout: 300s

There are multiple reasons why this can be useful:

  • better (and more descriptive) naming of google cloud functions. e.g. if you have multiple cloud functions in the same project, some are written in python and some in golang, you'll end up with names like backup_handler and BackupHandler
  • if you have a package named backup, golint recommends you have a function named Handler and not BackupHandler. But if you deploy Handler to google cloud, it's just not descriptive enough

peric avatar Feb 28 '19 14:02 peric

There are two PR related to that one https://github.com/serverless/serverless-google-cloudfunctions/pull/97 and https://github.com/serverless/serverless-google-cloudfunctions/pull/98 that have been open almost one year ago.

I have 3 stages (dev, staging, production) and because of the entry point and function name share the same name I can't have 3 different functions. If I deploy with production it will subscribe dev.

cirdes avatar Apr 09 '19 21:04 cirdes

Is someone ever going to consider this issue? It's been really annoying to deploy to different environments without being able to define function names.

lucas-paes-movile avatar Aug 16 '19 13:08 lucas-paes-movile

@pmuens may you take a look and do a merge for above PRs to release this feature ?

thucnc avatar Aug 29 '19 03:08 thucnc

Same issue as https://github.com/serverless/serverless-google-cloudfunctions/issues/84

Update: Posted a workaround solution on https://github.com/serverless/serverless-google-cloudfunctions/issues/84

joshuaquek avatar Jan 24 '20 10:01 joshuaquek