create_budget
async
¶
create_budget(
account_id: AccountId,
budget: Budget,
*,
config_overrides: Optional[AsyncBudgetsClientConfig] = None,
notifications_with_subscribers: Optional[NotificationWithSubscribersList] = None,
resource_tags: Optional[ResourceTagList] = None,
) -> CreateBudgetResponse
Creates a budget and, if included, notifications and subscribers.
Only one of BudgetLimit or PlannedBudgetLimits can be present in the syntax at one time. Use the syntax that matches your use case. The Request Syntax section shows the BudgetLimit syntax. For PlannedBudgetLimits, see the Examples section.
Similarly, only one set of filter and metric selections can be present in the syntax at one time. Either FilterExpression and Metrics or CostFilters and CostTypes, not both or a different combination. We recommend using FilterExpression and Metrics as they provide more flexible and powerful filtering capabilities. The Request Syntax section shows the FilterExpression/Metrics syntax.
Parameters:
-
account_id(AccountId) –The
accountIdthat is associated with the budget. -
budget(Budget) –The budget object that you want to create.
-
notifications_with_subscribers(Optional[NotificationWithSubscribersList], default:None) –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
CreateBudgetcall, Amazon Web Services creates the notifications and subscribers for you. -
resource_tags(Optional[ResourceTagList], default:None) –An optional list of tags to associate with the specified budget. Each tag consists of a key and a value, and each key must be unique for the resource.
Raises:
-
AccessDeniedException–You are not authorized to use this operation with the given parameters.
-
BillingViewHealthStatusException–The billing view status must be HEALTHY to perform this action. Try again when the status is HEALTHY.
-
CreationLimitExceededException–You've exceeded the notification or subscriber limit.
-
DuplicateRecordException–The budget name already exists. Budget names must be unique within an account.
-
InternalErrorException–An error on the server occurred during the processing of your request. Try again later.
-
InvalidParameterException–An error on the client occurred. Typically, the cause is an invalid input value.
-
NotFoundException–We can’t locate the resource that you specified.
-
ServiceQuotaExceededException–You've reached a Service Quota limit on this resource.
-
ThrottlingException–The number of API requests has exceeded the maximum allowed API request throttling limit for the account.
-
UnknownServiceError–The service returned an error code this client does not model.
Source code in docs_src/capo_budgets/_services/async_budgets.py
224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 | |