Skip to content

Instantly share code, notes, and snippets.

@necronet
Created January 2, 2021 23:58
Show Gist options
  • Select an option

  • Save necronet/8d8e50aabb28210ad6a5fcca992051a5 to your computer and use it in GitHub Desktop.

Select an option

Save necronet/8d8e50aabb28210ad6a5fcca992051a5 to your computer and use it in GitHub Desktop.

Revisions

  1. necronet created this gist Jan 2, 2021.
    14 changes: 14 additions & 0 deletions aws_dynamo_101.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,14 @@
    # List all the tables using a profile
    aws dynamodb list-tables --profile <profile_name> | jq

    # Get all item in a table using a profile (expensive)
    aws dynamodb scan --table-name <table_name> --profile <profile_name> | jq

    # Get an specific item based on id using a profile
    aws dynamodb get-item --key '{"id":{"S":"009871"}}' --table-name <table_name> --profile <profile_name> | jq

    # Create an item using a profile
    aws dynamodb put-item --table-name <table_name> --item file://item_example.json --profile <profile_name> | jq

    # Retrieve items as batch
    aws dynamodb batch-write-item --request-item file://batch_write_items.json | jq