Can the Lambda Test Tool retrieve a Lambda function's environment variables?
Description
Is it possible to retrieve a specific Lambda function's configurations/environment variables using the Lambda Test Tool? In other words: Can I debug locally with configurations from "remote" AWS using my IAM profile?
Note: I know you can have environment variables defined locally, but I was hoping if there existed an alternative where you could skip having any definitions locally?
What I thought would work
Remote
I have an existing Lambda Function named theFunctionName with the following environment variables:

Locally
Given the file: aws-lambda-tools-defaults.json
{
// Removed some lines for brevity
"profile": "IAM-tester",
"region": "eu-west-1",
"package-type": "image",
"function-name": "theFunctionName",
}
In the tool, apply the above configuration:

I expected the Lambda Test Tool to execute the code with the selected Lambda function's (here: theFunctionName) configuration and environment variables (i.e. finding the above environment variables secret_1, secret_2 and secret_3.
This is not the case.
Is this behaviour not possible / have I set it up incorrectly?
Thanks!
This is a :question: general question
Hi @TrongTheAlpaca, The Lambda Test Tool is a tool that can be used to load a .NET Core Lambda project and execute the selected code inside an emulated Lambda environment.
Currently, as you described earlier, it can have environment variables defined locally for setting up configurations but does not have the functionality to execute code using the lambda function configurations present in AWS console automatically.
If you prefer and would like to see this functionality, I could mark this as a feature request to be analyzed for implementation in the future.
Hope this helps!
I see, yeah I would love to see this as a feature! Would you mark it as Feature Request for me? 😀
@TrongTheAlpaca Good morning. I was going through the backlog and came across this issue. Just wanted to re-confirm, does your case involves Lambda Test Tool probe actual deployed function for the environment variables? If yes, then curious what happens in a scenario where the function is not actually deployed; does it follows the default path, i.e., not to probe for environment variables? You may also refer article https://blog.tonysneed.com/2018/12/16/add-net-core-di-and-config-goodness-to-aws-lambda-functions/ on how to define environment variables at development time. Lambda Test Tool is designed to test Lambda functions in local environment, so not sure if it would be feasible to to probe actual deployed Lambda function for environment variables. Please review.
Thanks, Ashish
This issue has not received a response in 5 days. If you want to keep this issue open, please just leave a comment below and auto-close will be canceled.