Tags in AWS | AWS Resource Tagging and Management using AWS CLI
In this article, I am going to explain you about the Tags in AWS. If you already know the Tag assigning in AWS Web Console, then this guide will help you assign the same Tags from the AWS CLI. So Let’s start the AWS Resource Tagging, its Benefits and Tag Management using AWS CLI. Check the below-attached Youtube video for more details.
Suggestible Read: Create an Amazon EC2 Instance from WebGUI
Also, Read: AWS Cloud: Saving Dollars with EC2 scheduling
What is a Tag in AWS?
A Tag is a label which can be assigned to Amazon Web Services (AWS) resources. Using tags AWS resources can be categorized easily.
Benefits of using the Tags
- Categories the resources.
- Resources can be easily identified.
- Help to manage the environment/resources easily.
- Helpful in cost calculations for AWS resources in big organizations
For example “Name” Tag on an AWS EC3 Instance, help to quickly identify the server. Cost Center tag can be used to check which dept used how much AWS resources. Hence making billing calculation easy.
Tag Properties and Restrictions
- Max 50 Tags per resources except for S3 bucket which support 10 tags as on date.
- Tags work in Key-Value pair. example “Key: Environment, Value: Test”
- Tags Key and Values are case sensitive
- All resources have default Tag “Name”
- Don’t use Tags starting aws:prefix. aws prefix is only allowed to use by AWS.
- Maximum key length—127 and Value length—255 Unicode characters in UTF-8
AWS Services Support Custom/Customer Tagging
Most of the AWS services supports user Tagging, for example, EC2, S3, and RDS.
AWS Services NOT Support Custom/Customer Tagging
Few services like ELB, SQS do not support customer-defined tags.
Most Common Tags:
Name – Default tag
Environment/Stack – Production/Development/Test/SIT
Application – Apache/Cognos/DB2/Oracle
Role – WebServer1/Certificate Server
Owner – Yogesh Kumar
Cost center – Finance/HR/Billing/IT
- There are no additional charges for using the Tags
- Tags can be added/modified on the fly. No downtime needed.
- Separate IAM roles can be created for permission to create/modify the tagging
Lab Today :
# aws ec2 describe-tags
# aws ec2 describe-tags –filters “Name=resource-type,Values=volume”
# aws elb describe-tags –load-balancer-name $LOADBALANCER
# aws ec2 create-tags –resources $INSTANCE_ID –tags Key=Stack,Value=Production
# aws ec2 create-tags –resources $VOLUME_ID –tags Key=Purpose,Value=RootDisk
Deleting a Tag
# aws ec2 delete-tags –resources $INSTANCE_ID –tags Key=Stack,Value=Production
Also, Check out the Video for more details: This video provides information on AWS resource tagging.
Summary: In this article, I hope you have learned the basics of understanding the Tags in AWS and it’s usage. check the next article to know more about AWS CLI Management.
Good to learn about: Amazon EBS | Live Volume Modifications