gordon icon indicating copy to clipboard operation
gordon copied to clipboard

Add the ability to customize lambda function upload name

Open glaurungg opened this issue 9 years ago • 5 comments
trafficstars

This allows lambdas uploaded to gordon to contain a chosen base function name, combined with "AWS::Region" and "Stage" references to keep uniqueness across stages / regions.

While I believe this is a generally positive feature that allows for greater customization, my specific use case is a chain of three lambda functions, the first one invoking the second lambda multiple times, and each of those second lambda's invocations invoking the third lambda once. With the current way that gordon deploys lambdas, their names all contain what I believe is the hexdigest of the lambda's zip file, making it hard to address gordon lambdas from within other lambdas.

This patch allows both strings and Refs to be specified for the function-name config value, allowing applications to much more easily programmatically determine other lambdas' names via the contexts field.

glaurungg avatar Jun 08 '16 20:06 glaurungg

Coolness, should there be a test for this new functionality though? At least to verify that gordon knows what to do with the function names across lambdas?

ausmith avatar Jun 29 '16 18:06 ausmith

This would be very helpful!!

owais avatar Aug 01 '16 17:08 owais

Waiting for this feature to be added to the core

jakubincloud avatar Sep 07 '16 15:09 jakubincloud

+1 we're using a similar setup where the lambda name is important for pulling configuration from dynamodb

ninjabear avatar Sep 09 '16 15:09 ninjabear

I am not 100% sure if this would work as intended. Based on my experience with Cloudformation, when the name of the resource is specified it then becomes impossible to update it using Cloudformation. The problem is that once the resource exists if CF needs to replace it, it can't create the new one because the names collide.

That been said (because of the lambda versions) that might not be the case here. See http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-function.html It looks like the onlychange that requires Replacement is the funcion-name itself which by definition would not be aproblem

Has anybody tried this live and manage to update the lambda after the name is fixed?

jorgebastida avatar Apr 06 '17 08:04 jorgebastida