PutItem.py 459 B

1234567891011121314151617181920
  1. #!/usr/bin/env python
  2. import boto3
  3. import json
  4. TABLE_NAME='elaborate_employee_table'
  5. client = boto3.client('dynamodb')
  6. response = client.put_item(
  7. TableName = TABLE_NAME,
  8. Item = {
  9. 'id': {'N': '5'},
  10. 'name': {'S': 'Arlyne'},
  11. 'contract_type': {'S': 'permanent'},
  12. 'position': {'S': 'data scientist'},
  13. 'last_accessed': {'N': '20190513'}
  14. },
  15. ReturnValues = 'ALL_OLD'
  16. )
  17. print(json.dumps(response, indent=4))