@datafire/amazonaws_budgets
Client library for AWS Budgets
Installation and Usage
npm install --save @datafire/amazonaws_budgets
let amazonaws_budgets = require('@datafire/amazonaws_budgets').create({
accessKeyId: "",
secretAccessKey: "",
region: ""
});
amazonaws_budgets.CreateBudget({
"AccountId": "",
"Budget": {
"BudgetName": "",
"TimeUnit": "",
"BudgetType": ""
}
}).then(data => {
console.log(data);
});
Description
Budgets enable you to plan your service usage, service costs, and your RI utilization. You can also track how close your plan is to your budgeted amount or to the free tier limits. Budgets provide you with a quick way to see your usage-to-date and current estimated charges from AWS and to see how much your predicted usage accrues in charges by the end of the month. Budgets also compare current estimates and charges to the amount that you indicated you want to use or spend and lets you see how much of your budget has been used. AWS updates your budget status several times a day. Budgets track your unblended costs, subscriptions, and refunds. You can create the following types of budgets:
-
Cost budgets allow you to say how much you want to spend on a service.
-
Usage budgets allow you to say how many hours you want to use for one or more services.
-
RI utilization budgets allow you to define a utilization threshold and receive alerts when RIs are tracking below that threshold.
You can create up to 20,000 budgets per AWS master account. Your first two budgets are free of charge. Each additional budget costs $0.02 per day. You can set up optional notifications that warn you if you exceed, or are forecasted to exceed, your budgeted amount. You can have notifications sent to an Amazon SNS topic, to an email address, or to both. For more information, see Creating an Amazon SNS Topic for Budget Notifications. AWS Free Tier usage alerts via AWS Budgets are provided for you, and do not count toward your budget limits.
Service Endpoint
The AWS Budgets API provides the following endpoint:
Actions
CreateBudget
amazonaws_budgets.CreateBudget({
"AccountId": "",
"Budget": {
"BudgetName": "",
"TimeUnit": "",
"BudgetType": ""
}
}, context)
Input
- input
object
- AccountId required AccountId
- Budget required Budget
- NotificationsWithSubscribers NotificationWithSubscribersList
Output
- output CreateBudgetResponse
CreateNotification
amazonaws_budgets.CreateNotification({
"AccountId": "",
"BudgetName": "",
"Notification": {
"NotificationType": "",
"ComparisonOperator": "",
"Threshold": 0
},
"Subscribers": []
}, context)
Input
- input
object
- AccountId required AccountId
- BudgetName required BudgetName
- Notification required Notification
- Subscribers required Subscribers
Output
- output CreateNotificationResponse
CreateSubscriber
amazonaws_budgets.CreateSubscriber({
"AccountId": "",
"BudgetName": "",
"Notification": {
"NotificationType": "",
"ComparisonOperator": "",
"Threshold": 0
},
"Subscriber": {
"SubscriptionType": "",
"Address": ""
}
}, context)
Input
- input
object
- AccountId required AccountId
- BudgetName required BudgetName
- Notification required Notification
- Subscriber required Subscriber
Output
- output CreateSubscriberResponse
DeleteBudget
amazonaws_budgets.DeleteBudget({
"AccountId": "",
"BudgetName": ""
}, context)
Input
- input
object
- AccountId required AccountId
- BudgetName required BudgetName
Output
- output DeleteBudgetResponse
DeleteNotification
amazonaws_budgets.DeleteNotification({
"AccountId": "",
"BudgetName": "",
"Notification": {
"NotificationType": "",
"ComparisonOperator": "",
"Threshold": 0
}
}, context)
Input
- input
object
- AccountId required AccountId
- BudgetName required BudgetName
- Notification required Notification
Output
- output DeleteNotificationResponse
DeleteSubscriber
amazonaws_budgets.DeleteSubscriber({
"AccountId": "",
"BudgetName": "",
"Notification": {
"NotificationType": "",
"ComparisonOperator": "",
"Threshold": 0
},
"Subscriber": {
"SubscriptionType": "",
"Address": ""
}
}, context)
Input
- input
object
- AccountId required AccountId
- BudgetName required BudgetName
- Notification required Notification
- Subscriber required Subscriber
Output
- output DeleteSubscriberResponse
DescribeBudget
amazonaws_budgets.DescribeBudget({
"AccountId": "",
"BudgetName": ""
}, context)
Input
- input
object
- AccountId required AccountId
- BudgetName required BudgetName
Output
- output DescribeBudgetResponse
DescribeBudgets
amazonaws_budgets.DescribeBudgets({
"AccountId": ""
}, context)
Input
- input
object
- AccountId required AccountId
- MaxResults MaxResults
- NextToken GenericString
Output
- output DescribeBudgetsResponse
DescribeNotificationsForBudget
amazonaws_budgets.DescribeNotificationsForBudget({
"AccountId": "",
"BudgetName": ""
}, context)
Input
- input
object
- AccountId required AccountId
- BudgetName required BudgetName
- MaxResults MaxResults
- NextToken GenericString
Output
DescribeSubscribersForNotification
amazonaws_budgets.DescribeSubscribersForNotification({
"AccountId": "",
"BudgetName": "",
"Notification": {
"NotificationType": "",
"ComparisonOperator": "",
"Threshold": 0
}
}, context)
Input
- input
object
- AccountId required AccountId
- BudgetName required BudgetName
- MaxResults MaxResults
- NextToken GenericString
- Notification required Notification
Output
UpdateBudget
amazonaws_budgets.UpdateBudget({
"AccountId": "",
"NewBudget": {
"BudgetName": "",
"TimeUnit": "",
"BudgetType": ""
}
}, context)
Input
Output
- output UpdateBudgetResponse
UpdateNotification
amazonaws_budgets.UpdateNotification({
"AccountId": "",
"BudgetName": "",
"OldNotification": {
"NotificationType": "",
"ComparisonOperator": "",
"Threshold": 0
},
"NewNotification": {
"NotificationType": "",
"ComparisonOperator": "",
"Threshold": 0
}
}, context)
Input
- input
object
- AccountId required AccountId
- BudgetName required BudgetName
- NewNotification required Notification
- OldNotification required Notification
Output
- output UpdateNotificationResponse
UpdateSubscriber
amazonaws_budgets.UpdateSubscriber({
"AccountId": "",
"BudgetName": "",
"Notification": {
"NotificationType": "",
"ComparisonOperator": "",
"Threshold": 0
},
"OldSubscriber": {
"SubscriptionType": "",
"Address": ""
},
"NewSubscriber": {
"SubscriptionType": "",
"Address": ""
}
}, context)
Input
- input
object
- AccountId required AccountId
- BudgetName required BudgetName
- NewSubscriber required Subscriber
- Notification required Notification
- OldSubscriber required Subscriber
Output
- output UpdateSubscriberResponse
Definitions
AccountId
- AccountId
string
: The account ID of the customer. It should be a 12 digit number.
Budget
- Budget
object
:Represents the output of the
CreateBudget
operation. The content consists of the detailed metadata and data file information, and the current status of thebudget
.The ARN pattern for a budget is:
arn:aws:budgetservice::AccountId:budget/budgetName
- BudgetLimit Spend
- BudgetName required BudgetName
- BudgetType required BudgetType
- CalculatedSpend CalculatedSpend
- CostFilters CostFilters
- CostTypes CostTypes
- TimePeriod TimePeriod
- TimeUnit required TimeUnit
BudgetName
- BudgetName
string
: A string represents the budget name. No ":" and "" character is allowed.
BudgetType
- BudgetType
string
(values: USAGE, COST, RI_UTILIZATION): The type of a budget. It should be COST, USAGE, or RI_UTILIZATION.
Budgets
- Budgets
array
: A list of budgets- items Budget
CalculatedSpend
- CalculatedSpend
object
:The spend objects associated with this budget. The
actualSpend
tracks how much you've used, cost, usage, or RI units, and theforecastedSpend
tracks how much you are predicted to spend if your current usage remains steady.For example, if it is the 20th of the month and you have spent
50
dollars on Amazon EC2, youractualSpend
is50 USD
, and yourforecastedSpend
is75 USD
.
ComparisonOperator
- ComparisonOperator
string
(values: GREATER_THAN, LESS_THAN, EQUAL_TO): The comparison operator of a notification. Currently we support less than, equal to and greater than.
CostFilters
- CostFilters
array
: A map that represents the cost filters applied to the budget.- items
object
- key GenericString
- value DimensionValues
- items
CostTypes
- CostTypes
object
: The types of cost included in a budget, such as tax and subscriptions.- IncludeCredit NullableBoolean
- IncludeDiscount NullableBoolean
- IncludeOtherSubscription NullableBoolean
- IncludeRecurring NullableBoolean
- IncludeRefund NullableBoolean
- IncludeSubscription NullableBoolean
- IncludeSupport NullableBoolean
- IncludeTax NullableBoolean
- IncludeUpfront NullableBoolean
- UseAmortized NullableBoolean
- UseBlended NullableBoolean
CreateBudgetRequest
- CreateBudgetRequest
object
: Request of CreateBudget- AccountId required AccountId
- Budget required Budget
- NotificationsWithSubscribers NotificationWithSubscribersList
CreateBudgetResponse
- CreateBudgetResponse
object
: Response of CreateBudget
CreateNotificationRequest
- CreateNotificationRequest
object
: Request of CreateNotification- AccountId required AccountId
- BudgetName required BudgetName
- Notification required Notification
- Subscribers required Subscribers
CreateNotificationResponse
- CreateNotificationResponse
object
: Response of CreateNotification
CreateSubscriberRequest
- CreateSubscriberRequest
object
: Request of CreateSubscriber- AccountId required AccountId
- BudgetName required BudgetName
- Notification required Notification
- Subscriber required Subscriber
CreateSubscriberResponse
- CreateSubscriberResponse
object
: Response of CreateSubscriber
CreationLimitExceededException
- CreationLimitExceededException
object
: You've exceeded the notification or subscriber limit.- Message errorMessage
DeleteBudgetRequest
- DeleteBudgetRequest
object
: Request of DeleteBudget- AccountId required AccountId
- BudgetName required BudgetName
DeleteBudgetResponse
- DeleteBudgetResponse
object
: Response of DeleteBudget
DeleteNotificationRequest
- DeleteNotificationRequest
object
: Request of DeleteNotification- AccountId required AccountId
- BudgetName required BudgetName
- Notification required Notification
DeleteNotificationResponse
- DeleteNotificationResponse
object
: Response of DeleteNotification
DeleteSubscriberRequest
- DeleteSubscriberRequest
object
: Request of DeleteSubscriber- AccountId required AccountId
- BudgetName required BudgetName
- Notification required Notification
- Subscriber required Subscriber
DeleteSubscriberResponse
- DeleteSubscriberResponse
object
: Response of DeleteSubscriber
DescribeBudgetRequest
- DescribeBudgetRequest
object
: Request of DescribeBudget- AccountId required AccountId
- BudgetName required BudgetName
DescribeBudgetResponse
- DescribeBudgetResponse
object
: Response of DescribeBudget- Budget Budget
DescribeBudgetsRequest
- DescribeBudgetsRequest
object
: Request of DescribeBudgets- AccountId required AccountId
- MaxResults MaxResults
- NextToken GenericString
DescribeBudgetsResponse
- DescribeBudgetsResponse
object
: Response of DescribeBudgets- Budgets Budgets
- NextToken GenericString
DescribeNotificationsForBudgetRequest
- DescribeNotificationsForBudgetRequest
object
: Request of DescribeNotificationsForBudget- AccountId required AccountId
- BudgetName required BudgetName
- MaxResults MaxResults
- NextToken GenericString
DescribeNotificationsForBudgetResponse
- DescribeNotificationsForBudgetResponse
object
: Response of GetNotificationsForBudget- NextToken GenericString
- Notifications Notifications
DescribeSubscribersForNotificationRequest
- DescribeSubscribersForNotificationRequest
object
: Request of DescribeSubscribersForNotification- AccountId required AccountId
- BudgetName required BudgetName
- MaxResults MaxResults
- NextToken GenericString
- Notification required Notification
DescribeSubscribersForNotificationResponse
- DescribeSubscribersForNotificationResponse
object
: Response of DescribeSubscribersForNotification- NextToken GenericString
- Subscribers Subscribers
DimensionValues
- DimensionValues
array
- items GenericString
DuplicateRecordException
- DuplicateRecordException
object
: The budget name already exists. Budget names must be unique within an account.- Message errorMessage
ExpiredNextTokenException
- ExpiredNextTokenException
object
: The pagination token expired.- Message errorMessage
GenericString
- GenericString
string
: A generic String.
GenericTimestamp
- GenericTimestamp
string
: A generic timestamp. In Java it is transformed to a Date object.
InternalErrorException
- InternalErrorException
object
: An error on the server occurred during the processing of your request. Try again later.- Message errorMessage
InvalidNextTokenException
- InvalidNextTokenException
object
: The pagination token is invalid.- Message errorMessage
InvalidParameterException
- InvalidParameterException
object
: An error on the client occurred. Typically, the cause is an invalid input value.- Message errorMessage
MaxResults
- MaxResults
integer
: An integer to represent how many entries a paginated response contains. Maximum is set to 100.
NotFoundException
- NotFoundException
object
: We can’t locate the resource that you specified.- Message errorMessage
Notification
- Notification
object
:A notification associated with a budget. A budget can have up to five notifications.
Each notification must have at least one subscriber. A notification can have one SNS subscriber and up to ten email subscribers, for a total of 11 subscribers.
For example, if you have a budget for 200 dollars and you want to be notified when you go over 160 dollars, create a notification with the following parameters:
-
A notificationType of
ACTUAL
-
A comparisonOperator of
GREATER_THAN
-
A notification threshold of
80
- ComparisonOperator required ComparisonOperator
- NotificationType required NotificationType
- Threshold required NotificationThreshold
- ThresholdType ThresholdType
-
NotificationThreshold
- NotificationThreshold
number
: The threshold of a notification. It should be a number between 0 and 1,000,000,000.
NotificationType
- NotificationType
string
(values: ACTUAL, FORECASTED): The type of a notification. It should be ACTUAL or FORECASTED.
NotificationWithSubscribers
- NotificationWithSubscribers
object
: A notification with subscribers. A notification can have one SNS subscriber and up to ten email subscribers, for a total of 11 subscribers.- Notification required Notification
- Subscribers required Subscribers
NotificationWithSubscribersList
- NotificationWithSubscribersList
array
: A list of Notifications, each with a list of subscribers.
Notifications
- Notifications
array
: A list of notifications.- items Notification
NullableBoolean
- NullableBoolean
boolean
NumericValue
- NumericValue
string
: A string to represent NumericValue.
Spend
- Spend
object
:The amount of cost or usage being measured for a budget.
For example, a
Spend
for3 GB
of S3 usage would have the following parameters:-
An
Amount
of3
-
A
unit
ofGB
- Amount required NumericValue
- Unit required UnitValue
-
Subscriber
- Subscriber
object
:The subscriber to a budget notification. The subscriber consists of a subscription type and either an Amazon Simple Notification Service topic or an email address.
For example, an email subscriber would have the following parameters:
-
A
subscriptionType
ofEMAIL
-
An
address
ofexample@example.com
- Address required SubscriberAddress
- SubscriptionType required SubscriptionType
-
SubscriberAddress
- SubscriberAddress
string
: String containing email or sns topic for the subscriber address.
Subscribers
- Subscribers
array
: A list of subscribers.- items Subscriber
SubscriptionType
- SubscriptionType
string
(values: SNS, EMAIL): The subscription type of the subscriber. It can be SMS or EMAIL.
ThresholdType
- ThresholdType
string
(values: PERCENTAGE, ABSOLUTE_VALUE): The type of threshold for a notification. It can be PERCENTAGE or ABSOLUTE_VALUE.
TimePeriod
- TimePeriod
object
: The period of time covered by a budget. Has a start date and an end date. The start date must come before the end date. There are no restrictions on the end date.- End GenericTimestamp
- Start GenericTimestamp
TimeUnit
- TimeUnit
string
(values: DAILY, MONTHLY, QUARTERLY, ANNUALLY): The time unit of the budget. e.g. MONTHLY, QUARTERLY, etc.
UnitValue
- UnitValue
string
: A string to represent budget spend unit. It should be not null and not empty.
UpdateBudgetRequest
- UpdateBudgetRequest
object
: Request of UpdateBudget
UpdateBudgetResponse
- UpdateBudgetResponse
object
: Response of UpdateBudget
UpdateNotificationRequest
- UpdateNotificationRequest
object
: Request of UpdateNotification- AccountId required AccountId
- BudgetName required BudgetName
- NewNotification required Notification
- OldNotification required Notification
UpdateNotificationResponse
- UpdateNotificationResponse
object
: Response of UpdateNotification
UpdateSubscriberRequest
- UpdateSubscriberRequest
object
: Request of UpdateSubscriber- AccountId required AccountId
- BudgetName required BudgetName
- NewSubscriber required Subscriber
- Notification required Notification
- OldSubscriber required Subscriber
UpdateSubscriberResponse
- UpdateSubscriberResponse
object
: Response of UpdateSubscriber
errorMessage
- errorMessage
string
: The error message the exception carries.