Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to rename ec2-instance name

I want to rename 100 ec2 instances using cli how to do that ?

This will show all instance names :

aws ec2 describe-instances --filters "Name=tag:productionpriority,Values=productionpriority" --query 'Reservations[].Instances[].[ [Tags[?Key==`Name`].Value][0][0],PublicIpAddress, PrivateIpAddress, InstanceId, InstanceType, Placement.AvailabilityZone]'

But how to modify Instance name ie replace old name with new one ?

like image 873
Ashish Karpe Avatar asked Mar 03 '16 12:03

Ashish Karpe


1 Answers

This worked for me:

ec2-create-tags  i-xxxx --tag "Name=PROD-DEL-xxx"
like image 63
Ashish Karpe Avatar answered Oct 11 '22 11:10

Ashish Karpe