I'm setting up a lambda function that pulls file objects from s3. I kept getting timeout errors, and after investigation it seems like the place where the code hangs is where I call s3.get_object(...), where s3 = boto3.client('s3')
It looks like all code involving boto3 has issues, because the aws secrets manager (uses boto3.session) also hangs.
I wondered if it was a credentials issues, but thought it wasn't likely since it's running from within a lambda function.
s3 = boto3.client('s3')
def handler(event, context):
"""
This function fetches content from MySQL RDS instance
"""
print("Received event: " + json.dumps(event, indent=2))
body_json = json.loads(event['Records'][0]['body'])
bucket = body_json["Records"][0]["s3"]["bucket"]["name"]
key = urllib.parse.unquote_plus(body_json["Records"][0]["s3"]['object']['key'], encoding='utf-8')
#Everything runs up to this line, and hangs from here on out
response = s3.get_object(Bucket=bucket, Key=key)
I think the strangest part is that everything about my code worked and functioned until a few hours ago, and I had no issues with s3. Not really sure what changed since I didn't change any of the lambda code...