Search code examples
amazon-web-servicesamazon-dynamodbamazon-cloudtrail

AWS CloudTrail DynamoDB response Element is always "null"


In AWS, I'm trying to set up CloudTrail logging on DynamoDB, to see what calls are being made and what effect that has on the DB records. I see the DB calls logged in CloudTrail, but the "responseElement" field is always "null".

According to the CloudTrail documentation, responseElement should be filled in "for actions that make changes (create, update, or delete actions)". But in the CloudTrail logs for PutItem or UpdateItem events, the responseElement is "null", even though the Dynamo records are created or updated.

I suspect there's a configuration option somewhere that I set incorrectly.

Does anyone know why I'm seeing "null" and how I can change CloudTrail to log the DynamoDB records that are being added or updated?


Solution

  • The default response to a PutItem request to DynamoDB is empty.

    If you want content in the response, you need to indicate some combination of the following in the PutItem request:

    • ReturnValues
    • ReturnConsumedCapacity
    • ReturnItemCollectionMetrics

    All of these default to NONE, in which case nothing is returned in the response.