Zappa
Zappa copied to clipboard
Allow Configuration of Lambda Name
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))
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.
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.
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.
Any updates, @Miserlou ?
Bump
Bump
@Miserlou Will this ever be considered?