HEX
Server: Apache
System: Linux srv1.prosuiteplus.com 5.4.0-216-generic #236-Ubuntu SMP Fri Apr 11 19:53:21 UTC 2025 x86_64
User: prosuiteplus (1001)
PHP: 8.3.20
Disabled: NONE
Upload Files
File: //lib/python3/dist-packages/awscli/examples/dynamodb/get-item.rst
**To read an item in a table**

The following ``get-item`` example retrieves an item from the ``MusicCollection`` table. The table has a hash-and-range primary key (``Artist`` and ``SongTitle``), so you must specify both of these attributes. ::

    aws dynamodb get-item \
        --table-name MusicCollection \
        --key file://key.json

Contents of ``key.json``::

    {
        "Artist": {"S": "Acme Band"},
        "SongTitle": {"S": "Happy Day"}
    }

Output::

    {
        "Item": {
            "AlbumTitle": {
                "S": "Songs About Life"
            }, 
            "SongTitle": {
                "S": "Happy Day"
            }, 
            "Artist": {
                "S": "Acme Band"
            }
        }
    }

For more information, see `Reading an Item <https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/WorkingWithItems.html#WorkingWithItems.ReadingData>`__ in the *Amazon DynamoDB Developer Guide*.