2回答
- 新しい順
- 投票が多い順
- コメントが多い順
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".
回答済み 3ヶ月前
関連するコンテンツ
- 質問済み 6年前
- AWS公式更新しました 1年前
- AWS公式更新しました 2年前
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.