Advertisement
Guest User

Untitled

a guest
Nov 17th, 2017
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.53 KB | None | 0 0
  1. import boto3
  2. import os
  3. import uuid
  4.  
  5. def lambda_handler(event, context):
  6.  
  7. cityName = event["cityName"]
  8. cityDescription = event["cityDescription"]
  9.  
  10. print('Input cityName: ' + cityName)
  11. print('Input Description: ' + cityDescription)
  12.  
  13. #Creating new record in DynamoDB table
  14. dynamodb = boto3.resource('dynamodb')
  15. table = dynamodb.Table(os.environ['DB_TABLE_NAME'])
  16. table.put_item(
  17. Item={
  18. 'city' : cityName,
  19. 'description' : cityDescription
  20. }
  21. )
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement