LambdaContext object has no attribute getRemainingTimeInMillis

Viewed 290

Code:

def lambda_handler(event, context):
    print('test')
    print(context.getRemainingTimeInMillis())

Error:

{
  "errorMessage": "'LambdaContext' object has no attribute 'getRemainingTimeInMillis'",
  "errorType": "AttributeError"
}

This is working on other functions with the same python3.9 runtime.

1 Answers

getRemainingTimeInMillis() is for nodejs. For python it should be:

context.get_remaining_time_in_millis()
Related