gordon
gordon copied to clipboard
Add the ability to customize lambda function upload name
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.
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?
This would be very helpful!!
Waiting for this feature to be added to the core
+1 we're using a similar setup where the lambda name is important for pulling configuration from dynamodb
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?