Created
August 15, 2024 07:10
-
-
Save guy9/d97140d5c94b7959da46d02f9d0545c5 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/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