Open thomascury opened 3 years ago
Since Python 2.7 is gone for Lambdas, I went with your changes but seeing this error when testing:
[ERROR] TypeError: BotoCoreError.__init__() takes 1 positional argument but 2 were given
Traceback (most recent call last):
File "/var/task/lambda_function.py", line 222, in lambda_handler
raise type(exc)(type(exc)(json.dumps(json_exc_status))).with_traceback(sys.exc_info()[2])
The last successful log message before that is Old IP was: 255.255.255.255
. So it is seeing my placeholder A record and the error seems to occur later.
Retested today (23/10/2023) with Lambda runtime py-3.8 and API Gateway invocation without any issue. Seems like your Lambda is catching an Exception from the boto3 lib, for which I have no visibility, you could try something like this to fire the original Exception if the raise in line 223 is failing:
finally:
try:
raise type(exc)(type(exc)(json.dumps(json_exc_status))).with_traceback(sys.exc_info()[2])
except:
raise exc
Migrated to python 3.8 Added ipv6 support PEP8 refactoring