create_subscriber

create_subscriber(**kwargs)

Creates a subscriber. You must create the associated budget and notification before you create the subscriber.

See also: AWS API Documentation

Request Syntax

response = client.create_subscriber(
    AccountId='string',
    BudgetName='string',
    Notification={
        'NotificationType': 'ACTUAL'|'FORECASTED',
        'ComparisonOperator': 'GREATER_THAN'|'LESS_THAN'|'EQUAL_TO',
        'Threshold': 123.0,
        'ThresholdType': 'PERCENTAGE'|'ABSOLUTE_VALUE',
        'NotificationState': 'OK'|'ALARM'
    },
    Subscriber={
        'SubscriptionType': 'SNS'|'EMAIL',
        'Address': 'string'
    }
)
Parameters
  • AccountId (string) --

    [REQUIRED]

    The accountId that is associated with the budget that you want to create a subscriber for.

  • BudgetName (string) --

    [REQUIRED]

    The name of the budget that you want to subscribe to. Budget names must be unique within an account.

  • Notification (dict) --

    [REQUIRED]

    The notification that you want to create a subscriber for.

    • NotificationType (string) -- [REQUIRED]

      Specifies whether the notification is for how much you have spent ( ACTUAL ) or for how much that you're forecasted to spend ( FORECASTED ).

    • ComparisonOperator (string) -- [REQUIRED]

      The comparison that's used for this notification.

    • Threshold (float) -- [REQUIRED]

      The threshold that's associated with a notification. Thresholds are always a percentage, and many customers find value being alerted between 50% - 200% of the budgeted amount. The maximum limit for your threshold is 1,000,000% above the budgeted amount.

    • ThresholdType (string) --

      The type of threshold for a notification. For ABSOLUTE_VALUE thresholds, Amazon Web Services notifies you when you go over or are forecasted to go over your total cost threshold. For PERCENTAGE thresholds, Amazon Web Services notifies you when you go over or are forecasted to go over a certain percentage of your forecasted spend. For example, if you have a budget for 200 dollars and you have a PERCENTAGE threshold of 80%, Amazon Web Services notifies you when you go over 160 dollars.

    • NotificationState (string) --

      Specifies whether this notification is in alarm. If a budget notification is in the ALARM state, you passed the set threshold for the budget.

  • Subscriber (dict) --

    [REQUIRED]

    The subscriber that you want to associate with a budget notification.

    • SubscriptionType (string) -- [REQUIRED]

      The type of notification that Amazon Web Services sends to a subscriber.

    • Address (string) -- [REQUIRED]

      The address that Amazon Web Services sends budget notifications to, either an SNS topic or an email.

      When you create a subscriber, the value of Address can't contain line breaks.

Return type

dict

Returns

Response Syntax

{}

Response Structure

  • (dict) --

    Response of CreateSubscriber

Exceptions

  • Budgets.Client.exceptions.InternalErrorException
  • Budgets.Client.exceptions.InvalidParameterException
  • Budgets.Client.exceptions.CreationLimitExceededException
  • Budgets.Client.exceptions.DuplicateRecordException
  • Budgets.Client.exceptions.NotFoundException
  • Budgets.Client.exceptions.AccessDeniedException
  • Budgets.Client.exceptions.ThrottlingException