Skip to content

Commit

Permalink
add: script for copying file to s3
Browse files Browse the repository at this point in the history
  • Loading branch information
nao1215 committed Dec 29, 2023
1 parent 3f92f2e commit ff184aa
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
Empty file removed script/.gitkeep
Empty file.
22 changes: 22 additions & 0 deletions script/create_s3objects.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#!/bin/bash
set -oeu pipefail

ROOT_DIR=$(git rev-parse --show-toplevel)
SCRIPT_DIR="${ROOT_DIR}/script"
THIS_SCRIPT="${SCRIPT_DIR}/create_s3objects.sh"

export AWS_PROFILE="localstack"

echo "creating 'test-bucket-on-localstack'(s3 bucket)"
aws s3 mb s3://test-bucket-on-localstack --endpoint-url=http://localhost:4566

echo "copying 10000 files to 'test-bucket-on-localstack'(s3 bucket)"
for i in {1..10000}; do
aws s3 cp "${THIS_SCRIPT}" "s3://test-bucket-on-localstack/object${i}.txt" --endpoint-url=http://localhost:4566 --quiet

if [ $((i % 100)) -eq 0 ]; then
echo "Processed $i objects"
fi
done

echo "done"

0 comments on commit ff184aa

Please sign in to comment.