I would like to deploy Python packages to EFS and use it in an AWS Lambda function. I was successful in adding EFS to one Lambda function and calling the Python package from it without any issues. However, when I added the same EFS to a different Lambda function and attempted to test it, the function got stuck in the code and timed out.
Since the first Lambda function worked properly, I do not believe it to be a configuration issue. Have you experienced this before? Please advise.
I found that code gets stuck when querying data from dynamoDB. However, it works find if I detach EFS.
def read_table(pk_key, sk_key, pk_value, sk_value):
table = boto3.resource('dynamodb').Table(settings.table_data)
query_response = table.query(
KeyConditionExpression=Key(pk_key).eq(pk_value) & Key(sk_key).eq(sk_value)
)
item = query_response['Items'][0]
return item