0
0
AWScloud~5 mins

Billing dashboard overview in AWS - Commands & Configuration

Choose your learning style9 modes available
Introduction
Managing cloud costs is important to avoid surprises. The AWS Billing Dashboard helps you see how much you spend and where your money goes. It gives a clear view of your charges and usage.
When you want to check your current AWS spending to stay within budget
When you need to understand which services are costing the most
When you want to set up alerts to avoid unexpected high bills
When you want to download detailed billing reports for accounting
When you want to track your monthly AWS usage and costs over time
Commands
This command fetches your AWS cost and usage data for May 2024, showing the total blended cost for the month.
Terminal
aws ce get-cost-and-usage --time-period Start=2024-05-01,End=2024-05-31 --granularity MONTHLY --metrics BlendedCost
Expected OutputExpected
{ "ResultsByTime": [ { "TimePeriod": { "Start": "2024-05-01", "End": "2024-05-31" }, "Total": { "BlendedCost": { "Amount": "123.45", "Unit": "USD" } } } ] }
--time-period - Specifies the start and end dates for the cost data
--granularity - Defines the level of detail (DAILY, MONTHLY, or HOURLY)
--metrics - Specifies which cost metric to retrieve
This command shows your AWS costs grouped by each service for May 2024, helping you see which services cost the most.
Terminal
aws ce get-cost-and-usage --time-period Start=2024-05-01,End=2024-05-31 --granularity MONTHLY --metrics BlendedCost --group-by Type=DIMENSION,Key=SERVICE
Expected OutputExpected
{ "ResultsByTime": [ { "TimePeriod": { "Start": "2024-05-01", "End": "2024-05-31" }, "Groups": [ { "Keys": ["Amazon EC2"], "Metrics": { "BlendedCost": { "Amount": "70.00", "Unit": "USD" } } }, { "Keys": ["Amazon S3"], "Metrics": { "BlendedCost": { "Amount": "30.00", "Unit": "USD" } } }, { "Keys": ["AWS Lambda"], "Metrics": { "BlendedCost": { "Amount": "23.45", "Unit": "USD" } } } ] } ] }
--group-by - Groups cost data by specified dimension, here by service
This command lists any budgets you have set up in your AWS account to monitor spending.
Terminal
aws budgets describe-budgets --account-id 123456789012
Expected OutputExpected
{ "Budgets": [ { "BudgetName": "MonthlyCostLimit", "BudgetLimit": { "Amount": "200", "Unit": "USD" }, "TimeUnit": "MONTHLY", "BudgetType": "COST" } ] }
--account-id - Specifies the AWS account to query budgets for
Key Concept

If you remember nothing else from this pattern, remember: the AWS Billing Dashboard and CLI let you track and understand your cloud costs clearly and early.

Common Mistakes
Using incorrect date format in the --time-period flag
The AWS CLI expects dates in YYYY-MM-DD format; wrong format causes errors or no data
Always use the exact YYYY-MM-DD format for start and end dates
Not specifying the --metrics flag when running cost queries
Without --metrics, the command returns no cost data or errors
Always include --metrics with a valid metric like BlendedCost or UnblendedCost
Running budget commands without the correct AWS account ID
Budgets are account-specific; wrong account ID returns empty or error
Use your actual AWS account ID when running budget-related commands
Summary
Use the AWS CLI cost explorer commands to get detailed cost and usage data.
Group costs by service to understand which parts of your cloud use the most money.
Check your budgets regularly to avoid unexpected charges.