gpt4 book ai didi

amazon-web-services - 如何查找最新或最新的AWS RDS快照?

转载 作者:行者123 更新时间:2023-12-03 15:16:35 27 4
gpt4 key购买 nike

我可以调用aws rds describe-db-snapshots --db-instance-identifier {my_db_instance}并对所有自动快照进行排序,以找到最新创建的快照,但我希望有人对此有更好的主意。

最佳答案

对我来说,这有效:

aws rds describe-db-snapshots \
--query="reverse(sort_by(DBSnapshots, &SnapshotCreateTime))[0]"

query参数自动对它们进行排序,并且仅返回最新的参数。

如果只需要Arn,这可能会有所帮助:
aws rds describe-db-snapshots \
--query="reverse(sort_by(DBSnapshots, &SnapshotCreateTime))[0]|DBSnapshotArn" \
--output text

以及特定数据库实例的所有内容:
aws rds describe-db-snapshots \
--db-instance-identifier={instance identifier} \
--query="reverse(sort_by(DBSnapshots, &SnapshotCreateTime))[0]|DBSnapshotArn" \
--output text

关于amazon-web-services - 如何查找最新或最新的AWS RDS快照?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38463085/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com