Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import boto3
- import os
- import uuid
- def lambda_handler(event, context):
- cityName = event["cityName"]
- cityDescription = event["cityDescription"]
- print('Input cityName: ' + cityName)
- print('Input Description: ' + cityDescription)
- #Creating new record in DynamoDB table
- dynamodb = boto3.resource('dynamodb')
- table = dynamodb.Table(os.environ['DB_TABLE_NAME'])
- table.put_item(
- Item={
- 'city' : cityName,
- 'description' : cityDescription
- }
- )
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement