user2987504
user2987504

Reputation: 737

change AWS AMI Name

is it possible to use the aws cli to change an AMI name?

I can successfully add a "Name" tag (using aws ec2 create-tags) but not change the "AMI Name" that shows on the web UI. This is an imported AMI so the AMI Name is something like
import-ami-XXXXX.

I've tried:

aws ec2 modify-image-attribute --image-id AMI_ID --attribute Name --value VALUE

but I'm getting back a:

An error occurred (InvalidParameterCombination) when calling the ModifyImageAttribute operation: No attributes specified.

any suggestion?

Upvotes: 11

Views: 13397

Answers (2)

ksasihytrust
ksasihytrust

Reputation: 11

I see two name like fields in the EC2 console for AMIs. One called "Name" and another one called "AMI Name". The latter is immutable, as the previous answer suggests.

BUT, I was able to set the "Name" field by using create-tags as shown below:

aws ec2 create-tags --resources AMI_ID --tags Key=Name,Value=bbb

Upvotes: 0

Matt Houser
Matt Houser

Reputation: 36053

It is not possible to change the name of an AMI image. Once the name is set, it cannot be changed.

You have 2 possible resolutions:

  1. Create the AMI image again, using a different name. However, in your case, the name may be automatically generated and this may not be an option.
  2. Copy the AMI within the same region, giving the copy a more desirable name.

Upvotes: 13

Related Questions