-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support for context.function_name? #681
Comments
@aniecki You can call Lambda's locally through the If you are using Windows or Mac, you will need to configure the endpoint to be
|
Also it is not clear to me (can't remember) the reason why we don't add the FunctionName to the env var. This could be due to we don't support or understand the |
@jfuss Any change you can expand on this ? I'm running aws-sam-cli in debug-api mode, and trying to make one lambda call another lambda. Here's my Template:
And running in a Lamda:
But I keep having the same |
I have the same use case as @ aniecki: I want to call a lambda function from itself, so I need a way to find out the name of the function currently executing. I want this to work both with Environment:
Variables:
JMY_LAMBDA_FUNCTION_NAME:
!GetAtt MyLambdaFunction.Arn However, this doesn't work due to a circular dependency of the function to itself. @jfuss: What is the recommended way to do this? Any plans to add the function name to the environment? For me, providing the correct value in |
This issue has not received any attention in 1 year. |
I am still interested in a solution. |
same here |
This is related to that right? #1177 |
So I was looking into this more. With recent changes (say last year or two), It's a pretty small change and just needs a couple tests with it. If someone is willing to contribute, we would be happy to review and get this patched. |
Description:
I want a lambda to call itself. I am using an expression inside a python programme
FunctionName=context.function_name
yet, it returns ResourceNotFoundException error as there is no such a function, actually somehow (why?) named test..
with the arn (as example) arn:aws:lambda::eu-west-1:104260451092:function:test.
If I set an enviroment variable: AWS_LAMBDA_FUNCTION_NAME inside template, it will work "almost" ok, but it will call aws account lambda, not the local one which I test.
So how to reference (the function name) of the locally invoked lambda function, so it will call itself ?
I thought it will be a name such as a copy of a main handler file - in my case name (name.py)
but no, as again - An error occurred (ResourceNotFoundException) when calling the Invoke operation: Function not found: arn:aws:lambda:eu-west-1:104260451092:function:main
Output of
sam --version
:SAM CLI, version 0.6.0
Hope there is still a way to pass a function name to the local lambda, not to call the aws one, but to call itself.
The text was updated successfully, but these errors were encountered: