Write to InfluxDB cloud fails with ApiException: (503) Reason: Service Unavailable; upstream connect error or disconnect/reset before headers. reset reason: connection failure

The error returned is caught in the catch section:

“traceback”: "Traceback (most recent call last):
File "/var/task/lambda_function.py", line 109, in lambda_handler\n influx_returns = write_api.write(InfluxBucket, "xxxxxxxxxxxxxxxx", Influx_lines,‘ms’)
influxdb_client.rest.ApiException: (503)
Reason: Service Unavailable
HTTP response headers: HTTPHeaderDict({‘Date’: ‘Thu, 02 Sep 2021 01:10:44 GMT’, ‘Content-Type’: ‘text/plain’, ‘Content-Length’: ‘91’, ‘Connection’: ‘keep-alive’, ‘Strict-Transport-Security’: ‘max-age=15724800; includeSubDomains’})
HTTP response body: upstream connect error or disconnect/reset before headers. reset reason: connection failure"