title: How to rename ec2-instance name
body: <p>I want to rename 100 ec2 instances using cli how to do that ? </p>
  
  <p>This will show all instance names : </p>
  
  <pre><code>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]'
  </code></pre>
  
  <p>But how to modify Instance name ie replace old name with new one ? </p>