2 Respuestas
- Más nuevo
- Más votos
- Más comentarios
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".
respondido hace 3 meses
Contenido relevante
- OFICIAL DE AWSActualizada hace 3 años
- OFICIAL DE AWSActualizada hace 3 años
- OFICIAL DE AWSActualizada hace 3 años
- OFICIAL DE AWSActualizada hace un año
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.