daily pastebin goal
49%
SHARE
TWEET

Untitled

a guest Nov 17th, 2017 59 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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.     )
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top