I'm trying to obtain the latest RDS Snapshot using the AWS SDK (Java, specifically). This has been asked and solved before using the AWS CLI (How to find latest or most recent AWS RDS snapshot?)
The proposed solutions all involve the --query
param which is conspicuously absent in the SDK:
aws rds describe-db-snapshots \
--query="reverse(sort_by(DBSnapshots, &SnapshotCreateTime))[0]"
Is there any way to do this using the SDK or do I have to get all of the paginated snapshots, gather the dates, and then sort and select the most recent?