DynamoDB allows for specification of secondary indexes to aid in this sort of query. Secondary indexes can either be global, meaning that the index spans the whole table across hash keys, or local meaning that the index would exist within each hash key partition, thus requiring the hash key to also be specified when making the query.
For the use case in this question, you would want to use a global secondary index on the "CreatedAt" field.
This sort of queries are dealt in differently in DynamoDB due to the specification of Secondary indexes.These can be both global and local.
Global the span of index is across whole table. Where local means the hash key will have to be specified when making the query. Yourr problem will be benefited by Global . This is for the sake of reference : https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/SecondaryIndexes.html