0

I am getting the following error when accessing to a lambda connected to a dynamo table which function is to write on it. The GET method works fine, the problem happens with de PUT method.

ERROR] ClientError: An error occurred (ValidationException) when calling the PutItem operation: One or more parameter values were invalid: Missing the key customer_id in the itemTraceback (most recent call last): File "/var/task/create.py", line 12, in create return todoList.todoList().put_item(event,context) File "/var/task/todoList.py", line 112, in put_item
table.put_item(Item=item) File "/var/runtime/boto3/resources/factory.py", line 520, in do_action
response = action(self, *args, **kwargs) File "/var/runtime/boto3/resources/action.py", line 83, in call
response = getattr(parent.meta.client, operation_name)(*args, **params) File "/var/runtime/botocore/client.py", line 357, in _api_call return self._make_api_call(operation_name, kwargs) File "/var/runtime/botocore/client.py", line 676, in _make_api_call
raise error_class(parsed_response, operation_name)

Any ideas on how to solve it? Thank you

1
  • It's useful to include error messages and exceptions but you should also include the relevant parts of your source code. Commented Jan 19, 2021 at 18:19

1 Answer 1

1

You are trying to create a new item (or in DynamoDB terms: put a new item) in the table.

The error states:

Missing the key customer_id in the item

That means that the item you are trying to put into your table is missing customer_id, as it is probably part of the hash or sort key.

To solve this set customer_id.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.