Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Apply and enforce cloud resource tagging strategies across AWS, Azure, GCP, and Kubernetes for cost allocation, ownership tracking, compliance, and automation. Use when implementing cloud governance, optimizing costs, or automating infrastructure management.
.claude/skills/ancoleman-resource-tagging/SKILL.md| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-12 | ✗→✓ | ▲ Improved | 559% | 0% |
| case-16 | ✗→✓ | ▲ Improved | 363% | 0% |
| case-17 | ✗→✓ | ▲ Improved | 130% | 0% |
| case-14 | ✓→✗ | ▼ Worse | 318% | 0% |
| case-20 | ✓→✗ | ▼ Worse | 163% | 0% |
Apply comprehensive cloud resource tagging strategies to enable cost allocation, ownership tracking, compliance enforcement, and infrastructure automation across multi-cloud environments.
Resource tagging provides the foundational metadata layer for cloud governance. Tags enable precise cost allocation (reducing unallocated spend by up to 80%), rapid ownership identification, compliance scope definition, and automated lifecycle management. Without proper tagging, cloud costs become untrackable, security incidents lack context, and automation policies fail to target resources effectively.
Use resource tagging when:
Start with the "Big Six" required tags for all cloud resources:
| Tag | Purpose | Example Value | |-----|---------|---------------| | Name | Human-readable identifier | prod-api-server-01 | | Environment | Lifecycle stage | prod \| staging \| dev | | Owner | Responsible team contact | platform-team@company.com | | CostCenter | Finance code for billing | CC-1234 | | Project | Business initiative | ecommerce-platform | | ManagedBy | Resource creation method | terraform \| pulumi \| manual |
Optional tags to add based on specific needs:
web, api, database, cache)daily, weekly, none)PCI, HIPAA, SOC2)critical, high, medium, low)Choose ONE naming convention organization-wide and enforce consistently:
| Convention | Format | Example | Best For | |------------|--------|---------|----------| | PascalCase | CostCenter, ProjectName | AWS standard | AWS-first orgs | | lowercase | costcenter, project | GCP labels (required) | GCP-first orgs | | kebab-case | cost-center, project-name | Azure (case-insensitive) | Azure-first orgs | | Namespaced | company:environment, team:owner | Multi-org tag policies | Large enterprises |
Critical: Case sensitivity varies by provider:
Environment ≠ environment)Environment = environment)environment only)environment ≠ Environment)For detailed taxonomy of all tag categories, see references/tag-taxonomy.md.
Operations-focused metadata: Name, Environment, Version, ManagedBy
Cost allocation metadata: Owner, CostCenter, Project, Department
Compliance metadata: Confidentiality, Compliance, DataClassification, SecurityZone
Lifecycle metadata: Backup, Monitoring, Schedule, AutoShutdown
Support metadata: SLA, ChangeManagement, CreatedBy, CreatedDate
Organization-specific metadata: Customer, Application, Component, Stack
| Provider | Tag Limit | Key Length | Value Length | Case Sensitive | Inheritance | |----------|-----------|------------|--------------|----------------|-------------| | AWS | 50 user-defined | 128 chars | 256 chars | Yes | Via tag policies | | Azure | 50 pairs | 512 chars | 256 chars | No | Via Azure Policy | | GCP | 64 labels | 63 chars | 63 chars | No | Via org policies | | Kubernetes | Unlimited | 253 prefix + 63 name | 63 chars | Yes | Via namespace |
Apply tags automatically via Terraform/Pulumi to reduce manual errors by 95%:
hcl# Terraform: Provider-level default tags provider "aws" { default_tags { tags = { Environment = var.environment Owner = var.owner CostCenter = var.cost_center Project = var.project ManagedBy = "terraform" } } }
All resources automatically inherit these tags. Resource-specific tags merge with defaults.
For complete Terraform, Pulumi, and CloudFormation examples, see examples/terraform/, examples/pulumi/, and examples/cloudformation/.
Enforce tagging at resource creation time:
AWS: Use AWS Config rules to check tag compliance (alert or deny) Azure: Use Azure Policy for tag inheritance and enforcement GCP: Use Organization Policies to restrict label values Kubernetes: Use OPA Gatekeeper or Kyverno for admission control
For enforcement implementation patterns, see references/enforcement-patterns.md.
Run regular audits (weekly recommended) to identify untagged resources:
AWS Config Query (SQL):
sqlSELECT resourceId, resourceType, configuration.tags WHERE resourceType IN ('AWS::EC2::Instance', 'AWS::RDS::DBInstance') AND (configuration.tags IS NULL OR NOT configuration.tags.Environment EXISTS)
Azure Resource Graph Query (KQL):
kustoResources | where type in~ ('microsoft.compute/virtualmachines') | where isnull(tags.Environment) or isnull(tags.Owner) | project name, type, resourceGroup, tags
GCP Cloud Asset Inventory:
bashgcloud asset search-all-resources \ --query="NOT labels:environment OR NOT labels:owner" \ --format="table(name,assetType,labels)"
For complete audit queries and scripts, see references/compliance-auditing.md and scripts/audit_tags.py.
Enable cost allocation tags to track spending by team, project, or department:
Activate cost allocation tags (up to 24 hours for activation):
hcl# Enable cost allocation tags via Terraform resource "aws_ce_cost_allocation_tag" "environment" { tag_key = "Environment" status = "Active" } resource "aws_ce_cost_allocation_tag" "project" { tag_key = "Project" status = "Active" }
Set up cost anomaly detection by tag to catch unusual spending:
hclresource "aws_ce_anomaly_monitor" "project_monitor" { name = "project-cost-monitor" monitor_type = "DIMENSIONAL" monitor_specification = jsonencode({ Tags = { Key = "Project" Values = ["ecommerce", "mobile-app"] } }) }
Group costs by tags in Azure Cost Management dashboards. Export cost data with tag breakdowns:
bashaz consumption usage list \ --start-date 2025-12-01 \ --query "[].{Cost:pretaxCost, Project:tags.Project, Team:tags.Owner}"
Export billing data to BigQuery with label breakdowns:
sqlSELECT labels.key AS label_key, labels.value AS label_value, SUM(cost) AS total_cost FROM `project.dataset.gcp_billing_export_v1_XXXXX` CROSS JOIN UNNEST(labels) AS labels WHERE labels.key IN ('environment', 'project', 'costcenter') GROUP BY label_key, label_value ORDER BY total_cost DESC
For cost allocation implementation details, see references/cost-allocation.md.
Determine which tags to enforce at creation time:
REQUIRED (enforce with hard deny):
RECOMMENDED (soft enforcement - alert only):
OPTIONAL (no enforcement):
Enforcement methods:
Reduce manual tagging effort through automatic inheritance:
Inherit tags from AWS Organizations account hierarchy:
json{ "tags": { "Environment": { "tag_key": { "@@assign": "Environment" }, "enforced_for": { "@@assign": ["ec2:instance", "s3:bucket"] } } } }
Use Azure Policy to inherit tags from resource groups:
hclresource "azurerm_policy_assignment" "inherit_environment" { name = "inherit-environment-tag" policy_definition_id = azurerm_policy_definition.inherit_tags.id parameters = jsonencode({ tagName = { value = "Environment" } }) }
Inherit labels from folders/projects via organization policies:
hclresource "google_organization_policy" "require_labels" { org_id = var.organization_id constraint = "constraints/gcp.resourceLabels" list_policy { allow { values = ["environment:prod", "environment:staging"] } inherit_from_parent = true } }
Use Kyverno to auto-generate labels from namespaces:
yamlapiVersion: kyverno.io/v1 kind: ClusterPolicy metadata: name: add-default-labels spec: rules: - name: add-environment-label match: resources: kinds: [Pod, Deployment] mutate: patchStrategicMerge: metadata: labels: +(environment): "{{request.namespace}}"
Problem: Multiple variations of the same tag across resources
yaml# BAD: Tag sprawl Environment: prod environment: production Env: prod ENVIRONMENT: PROD
Solution: Enforce single naming convention via IaC and tag policies
yaml# GOOD: Consistent naming Environment: prod # Single standard format
Problem: CLI/console-created resources missing required tags
Solution: Block untagged resource creation via Config/Policy rules, or use AWS Service Catalog/Azure Blueprints with pre-tagged templates
Problem: Tags are optional, frequently forgotten, leading to 35% unallocated spend
Solution: Use provider default tags in IaC + policy enforcement at account/subscription level
Problem: 30+ tags per resource, most unused, causing noise in cost reports
Solution: Start with "Big Six" required tags only. Add optional tags only when clear use case exists.
Problem: Tags set at creation but never updated (e.g., Owner outdated after team changes)
Solution: Run automated tag audits (weekly), use IaC to update tags programmatically, integrate with identity provider for owner updates
infrastructure-as-code: Tags applied automatically via Terraform/Pulumi modules with default_tags/stackTags
cost-optimization: Tags enable cost allocation, showback/chargeback, and budget alerts by project/team
compliance-frameworks: Tags prove PCI/HIPAA/SOC2 scope for audit trails and automated policy enforcement
security-hardening: Tags enforce security policies (e.g., public vs. internal access based on SecurityZone tag)
disaster-recovery: Tags identify resources for backup policies (e.g., Backup: daily triggers automated snapshots)
kubernetes-operations: Labels used for pod scheduling, resource quotas, network policies, and service selection
When implementing resource tagging:
| Provider | Enforcement Tool | Purpose | |----------|------------------|---------| | AWS | AWS Config Rules | Tag compliance monitoring + remediation | | AWS | Tag Policies (Organizations) | Enforce tags at account level | | Azure | Azure Policy | Tag enforcement + inheritance | | GCP | Organization Policies | Label restrictions + inheritance | | Kubernetes | OPA Gatekeeper | Admission control for labels | | Kubernetes | Kyverno | Auto-generate labels + validation |
| Tool | Purpose | |------|---------| | AWS Cost Explorer | Tag-based cost analysis + anomaly detection | | Azure Cost Management | Tag grouping + budgets | | GCP Cloud Billing | Label-based cost breakdown | | CloudHealth | Multi-cloud cost optimization | | Kubecost | Kubernetes cost allocation by labels |
| Tool | Purpose | |------|---------| | Checkov | IaC tag validation (pre-commit) | | tflint | Terraform linting for tag rules | | terraform-compliance | BDD tests for tag policies |
For detailed implementation guidance:
references/tag-taxonomy.mdreferences/enforcement-patterns.mdreferences/cost-allocation.mdreferences/compliance-auditing.mdexamples/terraform/examples/kubernetes/scripts/audit_tags.py, scripts/cost_by_tag.py| Case | Status | Duration (ms) | Turns | Tokens | Tool calls | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Without | With | Δ | Without | With | Δ | Without | With | Δ | Without | With | Δ | ||
case-01 | fail→fail | 17,125 | 23,599 | +38% | 1 | 1 | 0% | 3,104 | 8,088 | +161% | 0 | 0 | — |
case-02 | fail→fail | 25,081 | 25,589 | +2% | 1 | 1 | 0% | 4,397 | 8,577 | +95% | 0 | 0 | — |
case-08 | fail→fail | 9,911 | 7,898 | -20% | 1 | 1 | 0% | 1,680 | 5,048 | +200% | 0 | 0 | — |
case-09 | fail→fail | 12,972 | 10,600 | -18% | 1 | 1 | 0% | 2,169 | 5,679 | +162% | 0 | 0 | — |
case-03 | pass→pass | 10,565 | 7,917 | -25% | 1 | 1 | 0% | 1,916 | 5,151 | +169% | 0 | 0 | — |
case-04 | pass→pass | 9,083 | 8,617 | -5% | 1 | 1 | 0% | 1,452 | 5,128 | +253% | 0 | 0 | — |
case-05 | pass→pass | 4,245 | 3,338 | -21% | 1 | 1 | 0% | 706 | 4,438 | +529% | 0 | 0 | — |
case-06 | pass→pass | 10,235 | 11,008 | +8% | 1 | 1 | 0% | 1,884 | 5,663 | +201% | 0 | 0 | — |
case-07 | pass→pass | 12,525 | 17,945 | +43% | 1 | 1 | 0% | 2,148 | 7,142 | +232% | 0 | 0 | — |
case-10 | fail→fail | 11,712 | 8,285 | -29% | 1 | 1 | 0% | 2,075 | 5,278 | +154% | 0 | 0 | — |
case-11 | pass→pass | 13,832 | 9,688 | -30% | 1 | 1 | 0% | 2,394 | 5,648 | +136% | 0 | 0 | — |
case-12 | fail→pass | 4,792 | 4,830 | +1% | 1 | 1 | 0% | 700 | 4,614 | +559% | 0 | 0 | — |
case-13 | pass→pass | 13,646 | 22,202 | +63% | 1 | 1 | 0% | 2,379 | 6,971 | +193% | 0 | 0 | — |
case-14 | pass→fail | 13,945 | 10,456 | -25% | 1 | 1 | 0% | 1,336 | 5,587 | +318% | 0 | 0 | — |
case-15 | fail→fail | 16,410 | 17,022 | +4% | 1 | 1 | 0% | 2,514 | 6,461 | +157% | 0 | 0 | — |
case-16 | fail→pass | 6,929 | 6,215 | -10% | 1 | 1 | 0% | 1,038 | 4,808 | +363% | 0 | 0 | — |
case-17 | fail→pass | 11,893 | 6,514 | -45% | 1 | 1 | 0% | 2,109 | 4,845 | +130% | 0 | 0 | — |
case-18 | pass→pass | 15,910 | 17,441 | +10% | 1 | 1 | 0% | 2,410 | 6,879 | +185% | 0 | 0 | — |
case-19 | pass→pass | 12,297 | 12,390 | +1% | 1 | 1 | 0% | 1,934 | 5,739 | +197% | 0 | 0 | — |
case-20 | pass→fail | 14,305 | 15,445 | +8% | 1 | 1 | 0% | 2,639 | 6,950 | +163% | 0 | 0 | — |
case-21 | pass→fail | 7,901 | 7,386 | -7% | 1 | 1 | 0% | 1,685 | 5,189 | +208% | 0 | 0 | — |
case-22 | pass→fail | 7,767 | 8,098 | +4% | 1 | 1 | 0% | 1,448 | 5,126 | +254% | 0 | 0 | — |
DecimalAI ran this skill against gemini-3.6-flash twice over the same eval suite — once with the skill loaded and once without — and compared the two runs case by case. 22 cases were attempted. The headline lift of -5 percentage points is the difference between those two pass rates over the 22 comparable cases. 4 cases got worse with the skill loaded, and they are included in that figure.
Without the skill loaded, the model failed this case. With it loaded, the same prompt on the same model passed. This is one improved case from the latest verified run; every case, including any that regressed, is in the table above.
Other measured skills in the registry, with their headline benchmark lift.