I'm using a lambda to invoke another one with this piece of code:
import boto3
import json
# Lambda Handler
def lambla_handler(event,context):
lam = boto3.client('lambda', region_name='sa-east-1')
try:
response = lam.invoke(FunctionName='water_types', InvocationType='RequestResponse')
except Exception as e:
print(e)
raise e
print(response)
Everything is working fine, however when the lambda 'water_types' is getting this error:
water_types() takes 0 positional arguments but 2 were given: TypeError
Traceback (most recent call last):
File "/var/runtime/awslambda/bootstrap.py", line 250, in handle_event_request
result = request_handler(json_input, context)
TypeError: water_types() takes 0 positional arguments but 2 were given
As I can see, I'm not sending any arguments. Any idea how to fix it?
def water_types():
return print("water updated: 90")
water_types? I thinks you're missing the mandatory(event, context)arguments