Skip to content

Instantly share code, notes, and snippets.

@guy9
Created August 15, 2024 07:10
Show Gist options
  • Select an option

  • Save guy9/d97140d5c94b7959da46d02f9d0545c5 to your computer and use it in GitHub Desktop.

Select an option

Save guy9/d97140d5c94b7959da46d02f9d0545c5 to your computer and use it in GitHub Desktop.
#!/usr/bin/env sh
generate_25_items() {
local items=""
for i in `seq 1 25`; do
items="${items}"'{
"PutRequest": {
"Item": {
"id": { "S": "'"$(uuidgen)"'" },
"col1": { "S": "'"$(uuidgen)"'" },
"col2": { "S": "'"$(uuidgen)"'" },
"col3": { "S": "'"$(uuidgen)"'" },
"col4": { "S": "'"$(uuidgen)"'" },
"col5": { "S": "'"$(uuidgen)"'" }
}
}
},'
done
echo "${items%,}" # remove trailing comma
}
aws \
--endpoint-url http://localhost:8000 \
dynamodb batch-write-item \
--request-items '{
"Example": ['"$(generate_25_items)"']
}' > /dev/null
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment