Comparing EngineVersions of RDS DB snapshots

0

Hi,

I have a use case for comparing two DB snapshot engine versions. From https://docs.aws.amazon.com/sdkfornet/latest/apidocs/items/TRDSDBSnapshotNET45.html, 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?

Thanks,

2 個答案
0

Does this help?

$ aws rds describe-db-snapshots  --query "DBSnapshots[*].[DBSnapshotIdentifier,EngineVersion]" --output text
database-1-final-snapshot       13.4
AWS
管理員
philaws
已回答 4 個月前
profile pictureAWS
專家
已審閱 3 個月前
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':

https://stackoverflow.com/questions/2574080/sorting-a-list-of-dot-separated-numbers-like-software-versions

For other environments, search for the name of the language or framework and "version sort".

johrss
已回答 3 個月前

您尚未登入。 登入 去張貼答案。

一個好的回答可以清楚地回答問題並提供建設性的意見回饋,同時有助於提問者的專業成長。

回答問題指南