https://medium.com/lego-engineering/sequence-numbering-in-serverless-via-api-gateway-40e5f6c83e93
import json
import boto3
def lambda_handler(event, context):
# TODO implement
dynamodb = boto3.client('dynamodb')
rs = dynamodb.update_item(
TableName= "serial_gen",
Key= {
"id": {
"S": "100"
}
},
ExpressionAttributeValues= {
":val": {
"N": "1"
}
},
UpdateExpression= "SET seq = seq + :val",
ReturnValues= "UPDATED_NEW"
)
print(rs)
return "ok"