From 62b41afe29fa73a72a891c391acf7a2483a615b5 Mon Sep 17 00:00:00 2001 From: Sourav-Kumar-Panda <107533504+Sourav-Kumar-Panda@users.noreply.github.com> Date: Thu, 23 Nov 2023 19:27:27 +0530 Subject: [PATCH] aws-dynamodb: add page (#11570) * aws-dynamodb: add page --------- Co-authored-by: Sebastiaan Speck <12570668+sebastiaanspeck@users.noreply.github.com> Co-authored-by: K.B.Dharun Krishna --- pages/common/aws-dynamodb.md | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 pages/common/aws-dynamodb.md diff --git a/pages/common/aws-dynamodb.md b/pages/common/aws-dynamodb.md new file mode 100644 index 0000000000..34ec200774 --- /dev/null +++ b/pages/common/aws-dynamodb.md @@ -0,0 +1,36 @@ +# aws dynamodb + +> CLI for AWS dynamodb. +> More information: . + +- Create a table: + +`aws dynamodb create-table --table-name {{table_name}} --attribute-definitions {{AttributeName=S,AttributeType=S}} --key-schema {{AttributeName=S,KeyType=HASH}} --provisioned-throughput {{ReadCapacityUnits=5,WriteCapacityUnits=5}}` + +- List all tables in the DynamoDB: + +`aws dynamodb list-tables` + +- Get details about a specific table: + +`aws dynamodb describe-table --table-name {{table_name}}` + +- Add an item to a table: + +`aws dynamodb put-item --table-name {{table_name}} --item '{{{"AttributeName": {"S": "value"}}}}'` + +- Retrieve an item from a table: + +`aws dynamodb get-item --table-name {{table_name}} --key '{{{"ID": {"N": "1"}}}}'` + +- Update an item in the table: + +`aws dynamodb update-item --table-name {{table_name}} --key '{{{"ID": {"N": "1"}}}}' --update-expression "{{SET Name = :n}}" --expression-attribute-values '{{{":n": {"S": "Jane"}}}}'` + +- Scan items in the table: + +`aws dynamodb scan --table-name {{table_name}}` + +- Delete an item from the table: + +`aws dynamodb delete-item --table-name {{table_name}} --key '{{{"ID": {"N": "1"}}}}'`