'ILambdaContext.InvokedFunctionArn' always returning 'null'
See original GitHub issueDescription
I’ve created a new lambda function and I wanted to get the ARN for the function to pass along into my code for further processing. However, ILambdaContext.InvokedFunctionArn
is always returning null
, both when testing locally, as well as when calling the function in the real environment.
The documentation for the property does not state it can ever be null:
The ARN used to invoke this function. It can be function ARN or alias ARN. An unqualified ARN executes the $LATEST version and aliases execute the function version they are pointing to.
Reproduction Steps
- Create empty lambda
- Access the
InvokedFunctionArn
property in theILambdaContext
passed into the function - Check that the value is always
null
Environment
- Package Version:
Amazon.Lambda.Core v1.2.0
- OS Info: Windows 10
- Build Environment Visual Studio 2019
- Targeted .NET Platform: NetCore 3.1
Resolution
- 👋 I can/would-like-to implement a fix for this problem myself
This is a 🐛 bug-report
Issue Analytics
- State:
- Created 3 years ago
- Comments:12 (6 by maintainers)
Top Results From Across the Web
Access ILambdaContext in Lambda Entrypoint for dotnet ...
I've used an example from here to try override the FunctionHandlerAsync entrypoint but the Lambda context is null. I have also tried many...
Read more >Lambda Function Returning Null : r/aws
I am putting together a lambda function for updating users in the user pool, but no matter what I try I it always...
Read more >AWS Lambda context object in C# - ...
InvokedFunctionArn – The Amazon Resource Name (ARN) that's used to invoke the function. Indicates if the invoker specified a version number or alias....
Read more >A two week search for the missing body of a Lambda ...
If serverless-http was always returning an object, and the application was not throwing bogus errors, maybe the bug was inside the Lambda ...
Read more >Why is JSON.parse(event.body) returning null despite form ...
I'm trying to get values being passed into a form to themselves be passed to my lambda function backend. The first roadblock I...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
The feature to set the default values on the
ILambdaContext
forFunctionName
,InvokedFunctionArn
andAwsRequestId
has been released in version0.14.0
ofAmazon.Lambda.TestTool
.Agreed we should not close this. It goes along with other feature requests to customize the context object. Plus I do think a dummy arn is better then a null arn.