[Article by Tech Dive](https://tech-dive.xyz/2020/03/22/dynamodb%E3%81%B8csv%E3%83%87%E3%83%BC%E3%82%BF% E3% 82% 92% E7% B0% A1% E5% 8D% 98% E3% 81% AB% E3% 82% A4% E3% 83% B3% E3% 83% 9D% E3% 83% BC% E3% 83% 88% E3% 81% 99% E3% 82% 8B% E6% 96% B9% E6% B3% 95 /) was very helpful. We would like to take this opportunity to thank you.
This article is a memorandum when the above contents are implemented in a Windows environment.
・ Windows 10 ・ Git Bash
Install Python3
Install Pandas pip install pandas
Install aws cli
I couldn't use the ʻawscommand in Git Bash even after installing it, so in Git Bash
cmd \C aws --version`
You can use it after hitting and restarting
Confirm access key Create a new access key for import from "My Security Credentials" in the AWS user menu
Registration of access key and secret access key Hit ʻaws configure` and register the access key you created earlier
aws configure
AWS Access Key ID [None]: [access key]
AWS Secret Access Key [None]: [Secret access key]
Default region name [None]: us-east-2 * Region with table
Default output format [None]: json
Change CSV header Match the first line with the database key and specify the type by enclosing it in () Example) If the key is "UserName" (String), UserName (S)
Clone import_to_dynamodb
git clone https://github.com/hidesan-xyz/import_to_dynamodb.git
Put the csv file to import in the root of the cloned directory
Create a shell command for import
python create_insert_command.py importdata testtable
sh ./testtable_import_20200808164839.sh
The above procedure is complete.