2 Antworten
- Neueste
- Die meisten Stimmen
- Die meisten Kommentare
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".
beantwortet vor 3 Monaten
Relevanter Inhalt
- AWS OFFICIALAktualisiert vor 2 Jahren
- Warum dauert es so lange, einen Snapshot meiner Amazon RDS für MySQL-DB-Instance wiederherzustellen?AWS OFFICIALAktualisiert vor 3 Jahren
- AWS OFFICIALAktualisiert vor 2 Jahren
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.