| name | cloud-cost-allocation |
| description | Implement cloud cost allocation, tagging policies, and showback/chargeback systems. Outputs tagging standards, cost allocation reports, anomaly detection, and team budget dashboards. |
| argument-hint | ["cloud provider","team structure","current monthly spend","cost visibility maturity"] |
| allowed-tools | Read, Write, Bash |
Cloud Cost Allocation
Cost allocation makes cloud spending visible, attributable, and actionable. Without it, teams do not know what they are spending, nobody optimises, and the bill surprises everyone at month end.
Tagging Strategy
Every cloud resource must be tagged at creation time. Tags are enforced via AWS Service Control Policies, Azure Policy, or GCP Organization Constraints.
Required tags
- Environment: production, staging, dev
- Team: backend, platform, ml, data
- Service: orders-api, ml-training, analytics-pipeline
- CostCenter: CC-1234
- Owner: alice@company.com
Enforce in Terraform:
locals {
required_tags = {
Environment = var.environment
Team = var.team
Service = var.service_name
CostCenter = var.cost_center
Owner = var.owner_email
ManagedBy = "terraform"
}
}
AWS SCP to deny resource creation without required tags:
{
"Effect": "Deny",
"Action": ["ec2:RunInstances", "rds:CreateDBInstance", "s3:CreateBucket"],
"Resource": "*",
"Condition": {
"Null": {
"aws:RequestedTag/Team": "true",
"aws:RequestedTag/Service": "true"
}
}
}