- 新しい順
- 投票が多い順
- コメントが多い順
Since you said you are able to save to data to dynamodb there might not be an issue while saving, You can try to add your whole lambda code in try-except block and catch the exception and maybe add some traceback that will give you more idea of what error your logic gotten
def lambda_handler(event, context):
try:
# your awsm logic
resp = save_to_db()
helper()
except Exception as e:
logger.exception(e)
Hope that will help else you can put your code snippet error snapshots, cheers!
Another option is if you attached the Lambda function to a VPC, you need to create a DynamoDB endpoint in that VPC so that the function can access it.
Have you ensured that the Lambda function role has the right policies to access DynamoDB. Here is a blog that you can take a look at - https://aws.amazon.com/blogs/security/how-to-create-an-aws-iam-policy-to-grant-aws-lambda-access-to-an-amazon-dynamodb-table/
Also look at this document - https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_examples_lambda-access-dynamodb.html
Once you ensure that and if it still fails, then please follow Khushal's recommendation.
I have the same problem, and neither the except block nor the finally get triggered. I obtain a boto3.session --> (session.resource) db --> table but when I call scan() on the table it stalls and I never re-enter the code. The function times out, the container is not created, and I get 'No response from invoke container for <function name>' and an invalid lambda response, invalid json -- because I never re-enter my code to format the response.