From 4086df2dc426de7986985fc5d26a916e68e939fa Mon Sep 17 00:00:00 2001 From: Igor Serko Date: Tue, 2 Aug 2016 14:58:14 +0100 Subject: [PATCH] LambdaFunctionArn shouldn't be suffixed with the environment When configuring the S3 bucket event the function `add` builds the `LambdaFunctionConfigurations` which specifies the `LambdaFunctionArn`. The ARN should be the functions *exact* ARN and not suffixed by the environment ex.`arn:aws:lambda:us-west-1:1234567890123:function:bigquery_commit:main-env`. It makes the Lambda UI and the S3 event sources UI confused as they don't recognize that the specific Lambda function even exists. The reason why I made this change is because I had problems applying the bucket event cross-account and could not do this without this change. --- kappa/event_source/s3.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kappa/event_source/s3.py b/kappa/event_source/s3.py index 9e5d527..03ceb0f 100644 --- a/kappa/event_source/s3.py +++ b/kappa/event_source/s3.py @@ -37,7 +37,7 @@ def add(self, function): { 'Id': self._make_notification_id(function.name), 'Events': [e for e in self._config['events']], - 'LambdaFunctionArn': '%s:%s' % (function.arn, function._context.environment), + 'LambdaFunctionArn': function.arn, } ] }