DynamoDB is not responding to lambda

0

The dynamodb is getting connected and the data is also stored via console, but while doing CRUD operations in lambda there is no response sent and the code exits with 1. I have tried changing boto3 versions as well but there is no error thrown nor is the response coming.

Can someone please help us sort this?

3개 답변
2

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!

Khushal
답변함 2년 전
profile pictureAWS
전문가
검토됨 2년 전
  • 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.

1

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.

profile pictureAWS
전문가
Uri
답변함 2년 전
profile pictureAWS
전문가
검토됨 2년 전
0

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.

profile pictureAWS
전문가
답변함 2년 전

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠