HEX
Server: Apache
System: Linux pdx1-shared-a1-38 6.6.104-grsec-jammy+ #3 SMP Tue Sep 16 00:28:11 UTC 2025 x86_64
User: mmickelson (3396398)
PHP: 8.1.31
Disabled: NONE
Upload Files
File: //lib/python3/dist-packages/awscli/examples/dynamodb/transact-get-items.rst
**To retrieve multiple items atomically from one or more tables**

The following ``transact-get-items`` example retrieves multiple items atomically. ::

    aws dynamodb transact-get-items \
        --transact-items file://transact-items.json \
        --return-consumed-capacity TOTAL

Contents of ``transact-items.json``::

    [
        {
            "Get": {
                "Key": {
                    "Artist": {"S": "Acme Band"},
                    "SongTitle": {"S": "Happy Day"}
                },
                "TableName": "MusicCollection"
            }
        },
        {
            "Get": {
                "Key": {
                    "Artist": {"S": "No One You Know"},
                    "SongTitle": {"S": "Call Me Today"}
                },
                "TableName": "MusicCollection"
            }
        }
    ]

Output::

    {
        "ConsumedCapacity": [
            {
                "TableName": "MusicCollection",
                "CapacityUnits": 4.0,
                "ReadCapacityUnits": 4.0
            }
        ],
        "Responses": [
            {
                "Item": {
                    "AlbumTitle": {
                        "S": "Songs About Life"
                    },
                    "Artist": {
                        "S": "Acme Band"
                    },
                    "SongTitle": {
                        "S": "Happy Day"
                    }
                }
            },
            {
                "Item": {
                    "AlbumTitle": {
                        "S": "Somewhat Famous"
                    },
                    "Artist": {
                        "S": "No One You Know"
                    },
                    "SongTitle": {
                        "S": "Call Me Today"
                    }
                }
            }
        ]
    }

For more information, see `Managing Complex Workflows with DynamoDB Transactions <https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/transactions.html>`__ in the *Amazon DynamoDB Developer Guide*.