python - Creating dynamoDB table from JSON file -


i have massive json file has many items. trying create dynamodb table based on json file without having enter each individual attribute. have tried following awscli

aws dynamodb create-table --cli-input-json file://tabledefinition.json aws dynamodb create-table --generate-cli-skeleton 

as mentioned here ( create dynamodb table json ). have looked @ couple python libraries (ex https://github.com/jlafon/pynamodb) not have option. json files stored in s3 bucket.

note:

this generic class op doesn't have specific table definition mentioned.

the table definition json not equal normal data json. please see example of table definition json. need create similar 1 create table using json , aws cli.

{     "tablename": "musiccollection2",     "keyschema": [       { "attributename": "artist", "keytype": "hash" },       { "attributename": "songtitle", "keytype": "range" }     ],     "attributedefinitions": [       { "attributename": "artist", "attributetype": "s" },       { "attributename": "songtitle", "attributetype": "s" }     ],     "provisionedthroughput": {       "readcapacityunits": 5,       "writecapacityunits": 5     } } 

data load options:-

option 1:-

once table created, can write python code load data dynamodb. please note need map each attributes on json attributes on dynamodb table (or) store json map on dynamodb table. depends on use case i.e. how going use data loaded dynamodb table.

option 2:-

you can use aws data pipeline create mapping , load data dynamodb table. if 1 time load, can delete data pipeline once load complete.


Comments