title: Generating a unique key for dynamodb within a lambda function
body: <p>DynamoDB does not have the option to automatically generate a unique key for you.</p>
  
  <p>In examples I see people creating a uid out of a combination of fields, but is there a way to create a unique ID for data which does not have any combination of values that can act as a unique identifier? My questions is specifically aimed at lambda functions.</p>
  
  <p>One option I see is to create a uuid based on the timestamp with a counter at the end, insert it (or check if it exists) and in case of duplication retry with an increment until success. But, this would mean that I could potentially run over the execution time limit of the lambda function without creating an entry.</p>