Ad space (banner)
AD

Got the fundamentals? A structured AWS course is a fast way to level up.

Find AWS courses on Udemy

Affiliate link. Costs you nothing extra.

☁️AWS Lessons
Lesson 33 / 41

Adding Tags with aws ec2 create-tags

When you want to label a resource, use aws ec2 create-tags. It attaches one or more tags.

The syntax is aws ec2 create-tags --resources id --tags Key=Name,Value=value. Several resources and several tags can be given at once.

Running aws ec2 create-tags --resources i-0123456789abcdef0 --tags Key=Name,Value=web-server names that instance web-server, which is then what the console displays.

A common stumble is inconsistent tag keys across a team — env, Env and Environment all meaning the same thing, which breaks cost reports.

In real work, organisations agree a tagging convention up front and enforce it, because retrofitting one is painful.

AWS
Try it (type this into the pseudo terminal)
aws ec2 create-tags --resources i-0123456789abcdef0 --tags Key=Name,Value=web-server

🧑‍💻 You can type this command into the AWS pseudo terminal to try it yourself (this page itself has no interactive terminal).

Ad space (banner)
Ad space (in-article)