Table Of Contents

Feedback

User Guide

First time using the AWS CLI? See the User Guide for help getting started.

Note: You are viewing the documentation for an older major version of the AWS CLI (version 1).

AWS CLI version 2, the latest major version of AWS CLI, is now stable and recommended for general use. To view this page for the AWS CLI version 2, click here. For more information see the AWS CLI version 2 installation instructions and migration guide.

[ aws . budgets ]

create-budget

Description

Creates a budget and, if included, notifications and subscribers.

Warning

Only one of BudgetLimit or PlannedBudgetLimits can be present in the syntax at one time. Use the syntax that matches your case. The Request Syntax section shows the BudgetLimit syntax. For PlannedBudgetLimits , see the Examples section.

See also: AWS API Documentation

See 'aws help' for descriptions of global parameters.

Synopsis

  create-budget
--account-id <value>
--budget <value>
[--notifications-with-subscribers <value>]
[--cli-input-json <value>]
[--generate-cli-skeleton <value>]

Options

--account-id (string)

The accountId that is associated with the budget.

--budget (structure)

The budget object that you want to create.

Shorthand Syntax:

BudgetName=string,BudgetLimit={Amount=string,Unit=string},PlannedBudgetLimits={KeyName1={Amount=string,Unit=string},KeyName2={Amount=string,Unit=string}},CostFilters={KeyName1=string,string,KeyName2=string,string},CostTypes={IncludeTax=boolean,IncludeSubscription=boolean,UseBlended=boolean,IncludeRefund=boolean,IncludeCredit=boolean,IncludeUpfront=boolean,IncludeRecurring=boolean,IncludeOtherSubscription=boolean,IncludeSupport=boolean,IncludeDiscount=boolean,UseAmortized=boolean},TimeUnit=string,TimePeriod={Start=timestamp,End=timestamp},CalculatedSpend={ActualSpend={Amount=string,Unit=string},ForecastedSpend={Amount=string,Unit=string}},BudgetType=string,LastUpdatedTime=timestamp

JSON Syntax:

{
  "BudgetName": "string",
  "BudgetLimit": {
    "Amount": "string",
    "Unit": "string"
  },
  "PlannedBudgetLimits": {"string": {
        "Amount": "string",
        "Unit": "string"
      }
    ...},
  "CostFilters": {"string": ["string", ...]
    ...},
  "CostTypes": {
    "IncludeTax": true|false,
    "IncludeSubscription": true|false,
    "UseBlended": true|false,
    "IncludeRefund": true|false,
    "IncludeCredit": true|false,
    "IncludeUpfront": true|false,
    "IncludeRecurring": true|false,
    "IncludeOtherSubscription": true|false,
    "IncludeSupport": true|false,
    "IncludeDiscount": true|false,
    "UseAmortized": true|false
  },
  "TimeUnit": "DAILY"|"MONTHLY"|"QUARTERLY"|"ANNUALLY",
  "TimePeriod": {
    "Start": timestamp,
    "End": timestamp
  },
  "CalculatedSpend": {
    "ActualSpend": {
      "Amount": "string",
      "Unit": "string"
    },
    "ForecastedSpend": {
      "Amount": "string",
      "Unit": "string"
    }
  },
  "BudgetType": "USAGE"|"COST"|"RI_UTILIZATION"|"RI_COVERAGE"|"SAVINGS_PLANS_UTILIZATION"|"SAVINGS_PLANS_COVERAGE",
  "LastUpdatedTime": timestamp
}

--notifications-with-subscribers (list)

A notification that you want to associate with a budget. A budget can have up to five notifications, and each notification can have one SNS subscriber and up to 10 email subscribers. If you include notifications and subscribers in your CreateBudget call, AWS creates the notifications and subscribers for you.

Shorthand Syntax:

Notification={NotificationType=string,ComparisonOperator=string,Threshold=double,ThresholdType=string,NotificationState=string},Subscribers=[{SubscriptionType=string,Address=string},{SubscriptionType=string,Address=string}] ...

JSON Syntax:

[
  {
    "Notification": {
      "NotificationType": "ACTUAL"|"FORECASTED",
      "ComparisonOperator": "GREATER_THAN"|"LESS_THAN"|"EQUAL_TO",
      "Threshold": double,
      "ThresholdType": "PERCENTAGE"|"ABSOLUTE_VALUE",
      "NotificationState": "OK"|"ALARM"
    },
    "Subscribers": [
      {
        "SubscriptionType": "SNS"|"EMAIL",
        "Address": "string"
      }
      ...
    ]
  }
  ...
]

--cli-input-json (string) Performs service operation based on the JSON string provided. The JSON string follows the format provided by --generate-cli-skeleton. If other arguments are provided on the command line, the CLI values will override the JSON-provided values. It is not possible to pass arbitrary binary values using a JSON-provided value as the string will be taken literally.

--generate-cli-skeleton (string) Prints a JSON skeleton to standard output without sending an API request. If provided with no value or the value input, prints a sample input JSON that can be used as an argument for --cli-input-json. If provided with the value output, it validates the command inputs and returns a sample output JSON for that command.

See 'aws help' for descriptions of global parameters.

Examples

To create a Cost and Usage budget

The following create-budget command creates a Cost and Usage budget.

aws budgets create-budget \
    --account-id 111122223333 \
    --budget file://budget.json \
    --notifications-with-subscribers file://notifications-with-subscribers.json

Contents of budget.json:

{
    "BudgetLimit": {
        "Amount": "100",
        "Unit": "USD"
    },
    "BudgetName": "Example Tag Budget",
    "BudgetType": "COST",
    "CostFilters": {
        "TagKeyValue": [
            "user:Key$value1",
            "user:Key$value2"
        ]
    },
    "CostTypes": {
        "IncludeCredit": true,
        "IncludeDiscount": true,
        "IncludeOtherSubscription": true,
        "IncludeRecurring": true,
        "IncludeRefund": true,
        "IncludeSubscription": true,
        "IncludeSupport": true,
        "IncludeTax": true,
        "IncludeUpfront": true,
        "UseBlended": false
    },
    "TimePeriod": {
        "Start": 1477958399,
        "End": 3706473600
    },
    "TimeUnit": "MONTHLY"
}

Contents of notifications-with-subscribers.json:

[
    {
        "Notification": {
            "ComparisonOperator": "GREATER_THAN",
            "NotificationType": "ACTUAL",
            "Threshold": 80,
            "ThresholdType": "PERCENTAGE"
        },
        "Subscribers": [
            {
                "Address": "example@example.com",
                "SubscriptionType": "EMAIL"
            }
        ]
    }
]

Output

None