Unable set environment variables a run time while running the newman script from lambda

I am running a postman collection which sets the environment variables from one request and gets referred in the next request. It runs fine when running the newman script in local but I see that the variable is not set while running the same script from aws lambda. any suggestions please

I am using pm.environment.set(“variable_key”, “variable_value”); and getting an error in test script says “undefined in test-script”

Are you running newman with an environment argument passed in?