Bootstrap FreeKB - Amazon Web Services (AWS) - List Budgets using the AWS CLI
Amazon Web Services (AWS) - List Budgets using the AWS CLI

Updated:   |  Amazon Web Services (AWS) articles

This assumes you have already configured the aws command line tool. If not, check out my article on Getting Started with the AWS CLI.

Budgets can be used to do something, such as:

  • Send an email alert

When some conditiion is met, such as:

  • Spend is forcasted to exceed x
  • Spend has exceeded x

This is similar to setting up a Cloudwatch billing alert. Check out my article Create Billing Cloudwatch Alarm using the AWS CLI.

For example, you would receive an email like this.

 

The aws budgets describe-budgets command can be used to list the budgets you have created.

~]$ aws budgets describe-budgets --account-id 123456789012

{
    "Budgets": [
        {
            "BudgetName": "My Monthly Cost Budget",
            "BudgetLimit": {
                "Amount": "75.0",
                "Unit": "USD"
            },
            "CostFilters": {},
            "CostTypes": {
                "IncludeTax": true,
                "IncludeSubscription": true,
                "UseBlended": false,
                "IncludeRefund": false,
                "IncludeCredit": false,
                "IncludeUpfront": true,
                "IncludeRecurring": true,
                "IncludeOtherSubscription": true,
                "IncludeSupport": true,
                "IncludeDiscount": true,
                "UseAmortized": false
            },
            "TimeUnit": "MONTHLY",
            "TimePeriod": {
                "Start": "2024-02-01T00:00:00+00:00",
                "End": "2087-06-15T00:00:00+00:00"
            },
            "CalculatedSpend": {
                "ActualSpend": {
                    "Amount": "51.823",
                    "Unit": "USD"
                },
                "ForecastedSpend": {
                    "Amount": "97.027",
                    "Unit": "USD"
                }
            },
            "BudgetType": "COST",
            "LastUpdatedTime": "2024-02-16T02:05:07.729000+00:00"
        }
    ]
}

 

Similarly, the aws budgets describe-budget command can be used to list a specific budget.

~]$ aws budgets describe-budget --account-id 123456789012 --budget-name "My Monthly Cost Budget"
{
    "Budget": {
        "BudgetName": "My Monthly Cost Budget",
        "BudgetLimit": {
            "Amount": "1000.0",
            "Unit": "USD"
        },
        "CostFilters": {},
        "CostTypes": {
            "IncludeTax": true,
            "IncludeSubscription": true,
            "UseBlended": false,
            "IncludeRefund": false,
            "IncludeCredit": false,
            "IncludeUpfront": true,
            "IncludeRecurring": true,
            "IncludeOtherSubscription": true,
            "IncludeSupport": true,
            "IncludeDiscount": true,
            "UseAmortized": false
        },
        "TimeUnit": "MONTHLY",
        "TimePeriod": {
            "Start": "2024-02-01T00:00:00+00:00",
            "End": "2087-06-15T00:00:00+00:00"
        },
        "CalculatedSpend": {
            "ActualSpend": {
                "Amount": "751.823",
                "Unit": "USD"
            },
            "ForecastedSpend": {
                "Amount": "2197.027",
                "Unit": "USD"
            }
        },
        "BudgetType": "COST",
        "LastUpdatedTime": "2024-02-16T02:05:07.729000+00:00"
    }
}

 




Did you find this article helpful?

If so, consider buying me a coffee over at Buy Me A Coffee



Comments


Add a Comment


Please enter 7d792e in the box below so that we can be sure you are a human.