Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I have an automated script that runs ec2-create-image on my instances to have a highly available backup. When ec2-create-image is run it creates a snapshot with a blank "Name" field. Is there any way to change the "Name" field from the commandline?

I've looked at the man page for ec2-modify-snapshot-attribute, but this only seems to be able to modify permissions of a snapshot.

share|improve this question
add comment

1 Answer

up vote 3 down vote accepted

The 'Name' attribute of a snapshot is actually a tag. As such, you can change/set it with the ec2tag command line tool.

 ec2tag snap-xxxxxxxx -t Name=SNAP_NAME

As per the help file:

 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].

ec2tag is the 'shortform' of ec2addtag - they both do the same thing. They are included as part of the EC2 API tools.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.