Skip to content

Instantly share code, notes, and snippets.

@dariusjs
Created December 7, 2020 12:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dariusjs/cae96a1571983d56d17dd80ae82819b9 to your computer and use it in GitHub Desktop.
Save dariusjs/cae96a1571983d56d17dd80ae82819b9 to your computer and use it in GitHub Desktop.
#set($input = $ctx.args.dynamoRecord)
#set( $inputData = $util.dynamodb.toMapValues($input) )
#set ($expiryTime = $util.time.nowEpochSeconds() + 3600)
#set($inputData.ttl = $util.dynamodb.toNumber($expiryTime))
#set ($mutatedAt = $util.time.nowISO8601())
#set( $inputData.mutatedAt = $util.dynamodb.toString($mutatedAt))
{
"version": "2017-02-28",
"operation": "PutItem",
"key" : {
"id" : $util.dynamodb.toDynamoDBJson($util.autoId())
},
"attributeValues" : $util.toJson($inputData)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment