Comparing EngineVersions of RDS DB snapshots



I have a use case for comparing two DB snapshot engine versions. From, Engine Versions come as strings. Engine Versions seem to vary pattern according to the SQL engine used (E.g. mySQL and Postgres follow traditional semantic versioning "Major"."Minor"."Patch" but mySQL Aurora looks more like "5.7.mysql_aurora.2.11.1").

I have searched the documentation looking for a comprehensive guide or example list which could give me a clearer picture on how to parse and compare RDS DB snapshot engine versions reliably but I have not found much

I am looking for guidance. Is there some helper method in the .NET SDK that can perform this comparison for me? Do I have to parse these versions myself? And if yes, can you point me to some resource containing the used patterns so I may be more confident I am not missing any edge case?


2 Answers

Does this help?

$ aws rds describe-db-snapshots  --query "DBSnapshots[*].[DBSnapshotIdentifier,EngineVersion]" --output text
database-1-final-snapshot       13.4
answered 3 months ago
profile pictureAWS
reviewed 3 months ago

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 3 months ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions