ec2命令行快照重命名

我有一个自动化脚本,在我的实例上运行ec2-create-image以获得高度可用的备份。 当ec2-create-image运行时,它会创build一个带有空白“名称”字段的快照。 有没有办法从命令行更改“名称”字段?

我已经看过ec2-modify-snapshot-attribute的手册页,但是这似乎只能修改快照的权限。

快照的“名称”属性实际上是一个标签。 因此,您可以使用ec2tag命令行工具来更改/设置它。

  ec2tag snap-xxxxxxxx -t Name=SNAP_NAME 

根据帮助文件:

  SYNOPSIS ec2addtag ([ec2-create-tags, ec2tag]) ec2addtag [GENERAL OPTIONS] RESOURCE_ID [RESOURCE_ID ...] --tag KEY[=VALUE] [--tag KEY[=VALUE] ...] GENERAL NOTES Any command option/parameter may be passed a value of '-' to indicate that values for that option should be read from stdin. DESCRIPTION Adds a set of tags to a set of resources. To update a tag's key or value, you also use CreateTags. The new values overwrite the old values. -t, --tag TAG Tag in the form of key[=value]. 

ec2tagec2tag的“shortform” – 它们都做同样的事情。 它们是EC2 API工具的一部分。