AWS::Budgets::Budget - AWS CloudFormation

AWS::Budgets::Budget

The AWS::Budgets::Budget resource allows customers to take pre-defined actions that will trigger once a budget threshold has been exceeded. creates, replaces, or deletes budgets for Billing and Cost Management. For more information, see Managing Your Costs with Budgets in the AWS Billing and Cost Management User Guide.

Syntax

To declare this entity in your AWS CloudFormation template, use the following syntax:

JSON

{ "Type" : "AWS::Budgets::Budget", "Properties" : { "Budget" : BudgetData, "NotificationsWithSubscribers" : [ NotificationWithSubscribers, ... ] } }

YAML

Type: AWS::Budgets::Budget Properties: Budget: BudgetData NotificationsWithSubscribers: - NotificationWithSubscribers

Properties

Budget

The budget object that you want to create.

Required: Yes

Type: BudgetData

Update requires: No interruption

NotificationsWithSubscribers

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.

Required: No

Type: List of NotificationWithSubscribers

Maximum: 10

Update requires: Replacement

Return values

Ref

When you pass the logical ID of this resource to the intrinsic Ref function, Ref returns the name of the budget that is created by the template.

For more information about using the Ref function, see Ref.

Examples

Budget for 100 USD with two notifications

The following example creates a budget for 100 USD amount of costs, with notifications for when you have spent over 80 USD or over 99 USD. The notifications are sent to the subscribers email@example.com and email2@example.com.

JSON

{ "Description": "Basic Budget test", "Resources": { "Budget": { "Type": "AWS::Budgets::Budget", "Properties": { "Budget": { "BudgetLimit": { "Amount": "100", "Unit": "USD" }, "TimeUnit": "MONTHLY", "TimePeriod": { "Start": "1225864800", "End": "1926864800" }, "BudgetType": "COST", "CostFilters": { "AZ": [ "us-east-1", "us-west-1", "us-east-2" ] } }, "NotificationsWithSubscribers": [ { "Notification": { "NotificationType": "ACTUAL", "ComparisonOperator": "GREATER_THAN", "Threshold": 99 }, "Subscribers": [ { "SubscriptionType": "EMAIL", "Address": "email@example.com" }, { "SubscriptionType": "EMAIL", "Address": "email2@example.com" } ] }, { "Notification": { "NotificationType": "ACTUAL", "ComparisonOperator": "GREATER_THAN", "Threshold": 80 }, "Subscribers": [ { "SubscriptionType": "EMAIL", "Address": "email@example.com" } ] } ] } } }, "Outputs": { "BudgetId": { "Value": "BudgetExample" } } }

YAML

--- Description: "Basic Budget test" Resources: BudgetExample: Type: "AWS::Budgets::Budget" Properties: Budget: BudgetLimit: Amount: 100 Unit: USD TimeUnit: MONTHLY TimePeriod: Start: 1225864800 End: 1926864800 BudgetType: COST CostFilters: AZ: - us-east-1 - us-west-1 - us-east-2 NotificationsWithSubscribers: - Notification: NotificationType: ACTUAL ComparisonOperator: GREATER_THAN Threshold: 99 Subscribers: - SubscriptionType: EMAIL Address: email@example.com - SubscriptionType: EMAIL Address: email2@example.com - Notification: NotificationType: ACTUAL ComparisonOperator: GREATER_THAN Threshold: 80 Subscribers: - SubscriptionType: EMAIL Address: email@example.com Outputs: BudgetId: Value: !Ref BudgetExample

See also

  • CreateBudget in the AWS Cost Explorer Service Cost Management APIs