Zappa icon indicating copy to clipboard operation
Zappa copied to clipboard

Allow Configuration of Lambda Name

Open TimOrme opened this issue 7 years ago • 7 comments

Context

We'd ideally like to be able to configure the name of the lambda that zappa creates/uses. Right now, this is hardcoded to <project_name>-<api_stage>.

We'd like to be able to override this default behavior with a lambda name of our choosing. This would also potentially allow us to create the lambda outside of zappa and then only allow zappa access to update functions rather than create them, though Im not sure of the other implications of that approach. Either way, this seems like it would be a nice feature to have.

Expected Behavior

We could add an optional lambda_name function to the configuration file, which would be used in place of the default.

Possible Fix

I think this should be relatively straightforward to implement.

https://github.com/Miserlou/Zappa/blob/master/zappa/cli.py#L1989

Could be changed to:

self.lambda_name = self.stage_config.get('lambda_name', slugify.slugify(self.project_name + '-' + self.api_stage))

TimOrme avatar Jul 09 '18 21:07 TimOrme

agreed this would be nice. @Miserlou would you have any opinion on this? Looking to use this in an a environment with existing patterns in place.

claygorman avatar Aug 16 '18 20:08 claygorman

I would love to see this feature as well. Currently I have infrastructure managed via CloudFormation with Zappa not creating any resources. But I'd still like to run commands like zappa manage and zappa invoke. At the moment it will only work if the lambda name matches the pattern above, but it'd be nice if it were configurable as different organisations may have different conventions for lambda naming.

yoongkang avatar Oct 31 '19 02:10 yoongkang

Any update on this? It's becoming a more important feature since most workplaces have standard process of going through CodeBuild and other means to deploy. Not having full control over the lambda_name has me editing the cli.py temporarily to accommodate. We don't use anything but zappa package only before deploying the zip ourselves. But having zappa manage and zappa tail at our disposal locally is a big help in debugging.

deanq avatar Nov 22 '20 19:11 deanq

Any updates, @Miserlou ?

deanq avatar Jan 09 '21 01:01 deanq

Bump

deanq avatar Feb 22 '21 22:02 deanq

Bump

deanq avatar Jun 29 '21 09:06 deanq

@Miserlou Will this ever be considered?

deanq avatar Nov 10 '21 01:11 deanq