Resource tags, also known as metadata tags, are essential for managing infrastructure across various environments, including cloud platforms like AWS, GCP, and on-premise setups such as VMware or OpenStack. Tags are not specific to any cloud infrastructure and can be used universally to organize and identify resources effectively.

Why tags?

Establishing a comprehensive tagging strategy requires time and effort but offers significant benefits. It helps answer critical questions about workloads and deployments, such as:

  • What all does belong to an environment named A, or B, C?
  • How much resources is consumed by client A vs client B?
  • How much infrastructure does the company need to support the core business itself? (so corporate, shared services, ..)
  • If I have to patch/move/tier down (..) environment ABC – which consumer may be impacted by doing so?
  • In which AZ and Region is client A located from an application perspective?
  • Where is environment ABCD located at?
  • What hosts (instance types, storage etc) are connected to ABCD?
  • Team A needs AWS API access to maintain (i.e. stop, start, bounce) ABCD, GHI*PRD, … – to which resource tag group does these instances belong to?
  • Which ELB is used by ABCD?
  • Which security group belongs to CDEF?
  • What is AWS RDS XYZ used for?
  • What can be turned off during the weekend, off hours?
  • … and so forth

Benefits of Tags

Tags are crucial for maintaining a unified view of infrastructure. They enable better resource management, cost allocation, and automation. For example, tags can help identify resources that can be turned off during off-hours, reducing unnecessary costs.

In cloud-native services like AWS RDS or DynamoDB, where traditional hostnames may not be applicable, tags become indispensable for identifying the purpose and ownership of resources.

Clean Tagging Strategy

A well-structured tagging strategy is essential to avoid unnecessary overhead. Some tags, like those indicating the Availability Zone of an EC2 instance, might be redundant since this information is readily available through other means (e.g., AWS CLI, API).

Establishing Conventions

Before applying tags, it’s important to establish naming conventions that are generic enough to accommodate future changes. Considerations include:

  • Reusability: Create a library or dictionary to standardize and reuse tags across the organization.
  • Syntax and Structure: Define word length, special characters, and patterns (e.g., “prod” vs. “prd”).
  • Readability: Ensure tags are both human-readable and programmatically usable.

Comprehensive Tagging

When deploying resources like AWS EC2 instances, it’s crucial to assign proper tags not just to the instance but also to related components such as Security Groups, Subnets, EBS volumes, Launch Templates, and Auto Scaling Groups. This ensures a complete view of the deployment.

To enforce a tagging strategy, AWS IAM policies can be used, and AWS Lambda can automatically validate and correct tags during deployment.

What Are Tags Good For?

Beyond identification, tags are invaluable for cost assignments and analytics. Tools like AWS Cost Explorer provide detailed insights into budget spending, allowing for more precise cost distribution and optimization. Tags also simplify asset management and tasks like OS patching via AWS services such as AWS Systems Manager (SSM), making automation easier and more predictable.

Leave a comment