I am testing out boto with a local dynamodb docker container, I get this error while putting a new item into the table. The table exists.
from __future__ import print_function # Python 2/3 compatibility
import boto3
import os
os.environ["AWS_ACCESS_KEY_ID"] = "localaccesskey"
os.environ["AWS_SECRET_ACCESS_KEY"] = "password"
conn = boto3.resource('dynamodb', aws_access_key_id="localaccesskey", aws_secret_access_key="password", region_name='eu-west-1', endpoint_url="http://localhost:8000")
print(list(conn.tables.all()))
table = conn.Table('Movies')
table.put_item(
Item={
'username': 'janedoe',
'first_name': 'Jane',
'last_name': 'Doe',
'age': 25,
'account_type': 'standard_user',
}
)
error:
/usr/bin/python2.7 /home/kshk/PycharmProjects/Skulldogo/eli.py
[dynamodb.Table(name=u'Movies'), dynamodb.Table(name=u'devApiConfig'), dynamodb.Table(name=u'devApiKeys'), dynamodb.Table(name=u'devObjectCache'), dynamodb.Table(name=u'devSessionCache'), dynamodb.Table(name=u'test'), dynamodb.Table(name=u'test1'), dynamodb.Table(name=u'test10')]
Traceback (most recent call last):
File "/home/kshk/PycharmProjects/Skulldogo/eli.py", line 52, in <module>
'account_type': 'standard_user',
File "/usr/lib/python2.7/site-packages/boto3/resources/factory.py", line 518, in do_action
response = action(self, *args, **kwargs)
File "/usr/lib/python2.7/site-packages/boto3/resources/action.py", line 83, in __call__
response = getattr(parent.meta.client, operation_name)(**params)
File "/usr/lib/python2.7/site-packages/botocore/client.py", line 258, in _api_call
return self._make_api_call(operation_name, kwargs)
File "/usr/lib/python2.7/site-packages/botocore/client.py", line 548, in _make_api_call
raise ClientError(parsed_response, operation_name)
botocore.exceptions.ClientError: An error occurred (ValidationException) when calling the PutItem operation: One of the required keys was not given a value
any ideas???