How to use aws ec2 create-tags from aws cli to give different values to the same tag across multiple resources

0 votes

Suppose I have a list of instance ids and I want to change the tag "Name" to a certain value in all of those instances. I can run

aws ec2 create-tags --resources i-0ba60d097b9a4aebc i-051a64ccc686602e3 i-09c6265c16961a7a0 --tags Key=Name,Value=newname

and the value of the tag Name will change to newname in the three instances I specified. Is there a way to give a separate value to the tag Name for each of the three instances? That is newname1, newname2 and newname3 to the three respective instances.

aws ec2 create-tags --resources i-0ba60d097b9a4aebc --tags Key=Name,Value=newname1 --resources i-051a64ccc686602e3 --tags Key=Name,Value=newname2 --resources i-09c6265c16961a7a0 --tags Key=Name,Value=newname3

is not the correct syntax. I don't want to call aws ec2 create-tags separately for each instance.

Dec 15, 2022 in AWS by Tejashwini
• 3,820 points
1,474 views

No answer to this question. Be the first to respond.

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.

Related Questions In AWS

0 votes
1 answer

How to use aws s3 sync from the CLI?

Basically, This command is used to sync ...READ MORE

answered Oct 28 in AWS by Bhoomika
127 views
0 votes
1 answer

How to create key from aws cli?

Hi@akhtar, You can use the bellow given command ...READ MORE

answered Apr 27, 2020 in AWS by MD
• 95,460 points
734 views
0 votes
1 answer

How to edit files in the AWS S3 bucket from CLI?

Hi@akhtar, According to my knowledge,  you can't edit ...READ MORE

answered Jun 8, 2020 in AWS by MD
• 95,460 points
9,717 views
0 votes
1 answer

How to create an AWS EC2 Instance in the VPC with Boto3 module?

Hi@akhtar, You can use a network interface in ...READ MORE

answered Oct 11, 2020 in AWS by MD
• 95,460 points
2,534 views
0 votes
1 answer

AWS S3 uploading hidden files by default

versioning is enabled in your bucket. docs.aws.amazon.com/AmazonS3/latest/user-guide/….... the ...READ MORE

answered Oct 4, 2018 in AWS by Priyaj
• 58,020 points
6,004 views
–1 vote
1 answer

How to decrypt the encrypted S3 file using aws-encryption-cli --decrypt

Use command : aws s3 presign s3://mybucket/abc_count.png you get ...READ MORE

answered Oct 22, 2018 in AWS by Priyaj
• 58,020 points
5,231 views
0 votes
2 answers
0 votes
1 answer
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP