2 Answers
- Newest
- Most votes
- Most comments
0
Does this help?
$ aws rds describe-db-snapshots --query "DBSnapshots[*].[DBSnapshotIdentifier,EngineVersion]" --output text
database-1-final-snapshot 13.4
0
To check if the version numbers are identical, you can do a basic string comparison. To check whether one version is higher or lower than another requires a "version sort" on the strings, which looks at the numbers between delimiters like dot or dash, and considers "10" higher than "9" as opposed to the usual alphabetical order.
My code that uses "version sort" is normally in Python or bash. This answer shows how to do it in those languages, e.g. 'sort --version-sort':
For other environments, search for the name of the language or framework and "version sort".
answered 10 months ago
Relevant content
- asked 2 years ago
- Accepted Answerasked 2 years ago
- asked 2 months ago
- AWS OFFICIALUpdated 2 years ago
- AWS OFFICIALUpdated 2 years ago
- AWS OFFICIALUpdated 6 months ago
- AWS OFFICIALUpdated 2 years ago
Hi, this is based on API https://docs.aws.amazon.com/AmazonRDS/latest/APIReference/API_DBSnapshot.html that you can use in any available SDK if you need to use something else than CLI. See EngineVersion param.
To me, this answer does not address the poster's question, which was about parsing and comparing versions. Instead, this answer only shows how to retrieve the version - which the poster seems to already be able to do.