This steering file provides comprehensive guidance for implementing cloud financial management practices aligned with the AWS Well-Architected Cost Optimization Pillar's first design principle: Implement Cloud Financial Management.
Establish financial accountability and cost awareness across your organization to enable informed decision-making and cost optimization at scale.
Goal: Implement comprehensive financial governance framework for cloud costs
1. Monitor Budget Hierarchy
Use budgets to monitor existing:
- Organization-level master budget
- Business unit budgets
- Team/project-level budgets
- Service-specific budgets
2. Set up Cost Allocation
Use getCostAndUsage with tag-based filtering:
- Cost center allocation
- Project-based cost tracking
- Team responsibility assignment
- Business unit chargeback
3. Establish Anomaly Detection
Use cost_anomaly to implement:
- Service-level anomaly detection
- Account-level monitoring
- Budget variance alerts
- Automated escalation procedures
// Step 1: Monitor organization master budget status
const masterBudget = usePower("aws-cost-optimization", "aws-billing-cost-management", "budgets", {
"budget_name": "Organization-Master-Budget"
})
// Step 2: Monitor business unit budget performance
const engineeringBudget = usePower("aws-cost-optimization", "aws-billing-cost-management", "budgets", {
"budget_name": "Engineering-Department-Budget"
})
// Step 3: Analyze cost allocation by cost center
const costCenterAllocation = usePower("aws-cost-optimization", "aws-billing-cost-management", "cost_explorer", {
"operation": "getCostAndUsage",
"start_date": "2024-11-01",
"end_date": "2024-12-01",
"granularity": "MONTHLY",
"group_by": "[{\"Type\": \"TAG\", \"Key\": \"CostCenter\"}]",
"metrics": "[\"UnblendedCost\"]"
})
// Step 4: Set up comprehensive anomaly detection
const anomalyDetection = usePower("aws-cost-optimization", "aws-billing-cost-management", "cost_anomaly", {
"start_date": "2024-11-01",
"end_date": "2024-12-01",
"total_impact_start": 100, // Alert on anomalies > $100
"total_impact_operator": "GREATER_THAN_OR_EQUAL"
})
Goal: Implement accurate cost allocation and chargeback mechanisms
1. Analyze Current Tagging Strategy
Use get_tag_values to:
- Identify existing cost allocation tags
- Assess tagging coverage
- Find untagged resources
- Plan tagging improvements
2. Implement Multi-Dimensional Cost Allocation
Use getCostAndUsage with multiple groupings:
- Department + Project allocation
- Environment + Application allocation
- Team + Service allocation
- Business unit + Cost center allocation
3. Generate Chargeback Reports
Use session_sql for custom allocation logic:
- Proportional shared cost allocation
- Usage-based chargeback calculations
- Business metric correlation
- Executive reporting formats
// Step 1: Analyze current tagging coverage
const availableTags = usePower("aws-cost-optimization", "aws-billing-cost-management", "cost_explorer", {
"operation": "getTagValues",
"start_date": "2024-11-01",
"end_date": "2024-12-01",
"tag_key": "Project"
})
// Step 2: Multi-dimensional cost allocation
const projectCosts = usePower("aws-cost-optimization", "aws-billing-cost-management", "cost_explorer", {
"operation": "getCostAndUsage",
"start_date": "2024-11-01",
"end_date": "2024-12-01",
"granularity": "MONTHLY",
"group_by": "[{\"Type\": \"TAG\", \"Key\": \"Project\"}, {\"Type\": \"TAG\", \"Key\": \"Environment\"}]",
"metrics": "[\"UnblendedCost\"]"
})
// Step 3: Department-level chargeback analysis
const departmentChargeback = usePower("aws-cost-optimization", "aws-billing-cost-management", "cost_explorer", {
"operation": "getCostAndUsage",
"start_date": "2024-11-01",
"end_date": "2024-12-01",
"granularity": "MONTHLY",
"group_by": "[{\"Type\": \"TAG\", \"Key\": \"Department\"}, {\"Type\": \"DIMENSION\", \"Key\": \"SERVICE\"}]",
"metrics": "[\"UnblendedCost\"]"
})
// Step 4: Generate executive chargeback report
const chargebackReport = usePower("aws-cost-optimization", "aws-billing-cost-management", "session_sql", {
"query": `
SELECT
department,
project,
SUM(cost) as total_cost,
SUM(cost) / (SELECT SUM(cost) FROM costs) * 100 as cost_percentage
FROM costs
WHERE month = '2024-11'
GROUP BY department, project
ORDER BY total_cost DESC
`
})
Goal: Establish comprehensive financial reporting aligned with business objectives
1. Define Cost KPIs
Establish metrics such as:
- Cost per customer/transaction
- Cost per business unit/department
- Cost efficiency ratios
- Budget variance percentages
2. Implement Regular Reporting
Use getCostAndUsageComparisons for:
- Month-over-month variance reports
- Year-over-year growth analysis
- Budget vs actual performance
- Forecast accuracy tracking
3. Create Executive Dashboards
Use generate_cost_report for:
- Executive summary reports
- Department performance dashboards
- Cost optimization scorecards
- ROI tracking reports
// Step 1: Monthly variance analysis
const monthlyVariance = usePower("aws-cost-optimization", "aws-billing-cost-management", "cost_comparison", {
"operation": "getCostAndUsageComparisons",
"baseline_start_date": "2024-10-01",
"baseline_end_date": "2024-11-01",
"comparison_start_date": "2024-11-01",
"comparison_end_date": "2024-12-01",
"metric_for_comparison": "UnblendedCost",
"group_by": "[{\"Type\": \"TAG\", \"Key\": \"Department\"}]"
})
// Step 2: Budget performance analysis
const budgetPerformance = usePower("aws-cost-optimization", "aws-billing-cost-management", "budgets", {
"budget_name": "Engineering-Department-Budget"
})
// Step 3: Cost per business metric calculation
const businessMetricCosts = usePower("aws-cost-optimization", "aws-billing-cost-management", "session_sql", {
"query": `
SELECT
month,
total_cost,
active_users,
total_cost / active_users as cost_per_user,
transactions,
total_cost / transactions as cost_per_transaction
FROM business_metrics
WHERE month >= '2024-06-01'
ORDER BY month
`
})
// Step 4: Generate executive cost report
const executiveReport = usePower("aws-cost-optimization", "aws-pricing", "generate_cost_report", {
"pricing_data": monthlyVariance,
"service_name": "Organization Cost Summary",
"assumptions": [
"All costs allocated to appropriate cost centers",
"Shared services allocated proportionally",
"Reserved Instance benefits distributed to users"
],
"recommendations": {
"immediate": [
"Implement automated budget alerts for all departments",
"Establish monthly cost review meetings",
"Create cost optimization targets for each business unit"
],
"strategic": [
"Develop cost-aware culture through training",
"Implement cost optimization incentives",
"Establish cloud center of excellence"
]
}
})
// Automated budget monitoring based on historical patterns
const budgetMonitoring = usePower("aws-cost-optimization", "aws-billing-cost-management", "budgets", {
"max_results": 100
})
// Use forecast data to predict budget performance
const budgetForecast = usePower("aws-cost-optimization", "aws-billing-cost-management", "cost_explorer", {
"operation": "getCostForecast",
"start_date": "2024-12-01",
"end_date": "2025-01-01",
"granularity": "MONTHLY",
"metric": "UNBLENDED_COST",
"filter": "{\"Tags\": {\"Key\": \"Department\", \"Values\": [\"Engineering\"], \"MatchOptions\": [\"EQUALS\"]}}"
})
// Comprehensive anomaly monitoring
const anomalyMonitoring = usePower("aws-cost-optimization", "aws-billing-cost-management", "cost_anomaly", {
"start_date": "2024-11-01",
"end_date": "2024-12-01",
"feedback": "NO", // Focus on unacknowledged anomalies
"total_impact_start": 50 // Alert on anomalies > $50
})
// Automated cost allocation reporting
const allocationReport = usePower("aws-cost-optimization", "aws-billing-cost-management", "session_sql", {
"query": `
WITH shared_costs AS (
SELECT SUM(cost) as total_shared
FROM costs
WHERE service IN ('AWS Support', 'AWS CloudTrail', 'AWS Config')
),
department_usage AS (
SELECT department, SUM(cost) as dept_cost
FROM costs
WHERE service NOT IN ('AWS Support', 'AWS CloudTrail', 'AWS Config')
GROUP BY department
)
SELECT
d.department,
d.dept_cost,
(d.dept_cost / SUM(d.dept_cost) OVER()) * s.total_shared as allocated_shared,
d.dept_cost + (d.dept_cost / SUM(d.dept_cost) OVER()) * s.total_shared as total_allocated
FROM department_usage d
CROSS JOIN shared_costs s
`
})
Solution:
Solution:
Solution:
Solution: