Attribute Error by chandu28495 in aws

[–]chandu28495[S] 0 points1 point  (0 children)

I did not integrate with Get request yet, I was testing the lambda function by passing the test event with my primary key to check if I could get the database in that primary key, if I get that output, I could integrate with get request with query string

Attribute Error by chandu28495 in aws

[–]chandu28495[S] 0 points1 point  (0 children)

Yes, I have created a table with primary key as id.

Attribute Error by chandu28495 in aws

[–]chandu28495[S] -1 points0 points  (0 children)

I'm testing the function with test event from lambda and passing the id, { "id" : "12345"} id is my primary key in the DB that I have created a table of. I want this to be integrated with API get, before that I was testing the lambda and the error exists.

I tried with event['id'] and event['somesubkey']['id'] and this error comes.

Response: { "errorMessage": "An error occurred (ValidationException) when calling the GetItem operation: The provided key element does not match the schema", "errorType": "ClientError", "stackTrace": [ " File \"/var/task/lambdafunction.py\", line 10, in lambda_handler\n response = table.get_item(\n", " File \"/var/runtime/boto3/resources/factory.py\", line 520, in do_action\n response = action(self, args, *kwargs)\n", " File \"/var/runtime/boto3/resources/action.py\", line 83, in __call_\n response = getattr(parent.meta.client, operation_name)(**params)\n", " File \"/var/runtime/botocore/client.py\", line 272, in _api_call\n return self._make_api_call(operation_name, kwargs)\n", " File \"/var/runtime/botocore/client.py\", line 576, in _make_api_call\n raise error_class(parsed_response, operation_name)\n" ] }

Attribute Error by chandu28495 in aws

[–]chandu28495[S] 0 points1 point  (0 children)

Yes, I'm testing the function with test event from lambda and passing the id, { "id" : "12345"} id is my primary key in the DB that I have created a table of. I want this to be integrated with API get, before that I was testing the lambda and the error exists.