Amazon Web Services (AWS) resources tags are metadata labels with keys and optional values used to categorize and manage resources.
Proper tagging enhances resource discovery, lifecycle management, and overall productivity within the AWS environment. If tags do not comply with the AWS format, it can lead to confusion and inefficiency in managing resources, as well as unexpected behavior of the system.
AWS resource tags should comply with the format stated in AWS documentation. That is, tag keys should:
_ . : / = + - @ " aws:
resource "aws_s3_bucket" "examplebucket" {
bucket = "mybucketname"
tags = {
"anycompany:~cost-center~" = "Accounting"
}
}
resource "aws_s3_bucket" "examplebucket" {
bucket = "mybucketname"
tags = {
"anycompany:cost-center" = "Accounting"
}
}