MDAA TS Docs
    Preparing search index...

    Token-use alarms notifying an existing SNS topic.

    Use cases: routing token-use alarms to an existing operations or cost topic

    AWS: CloudWatch alarms on AWS/Bedrock token metrics publishing to an existing SNS topic

    Validation: notificationTopicArn required; createNotificationTopic and notificationEmails not allowed

    interface TokenUsageAlarmsExistingTopicProps {
        accountTotal?: TokenThresholdsProps;
        datapointsToAlarm?: number;
        evaluationPeriods?: number;
        models?: NamedModelTokenAlarmProps;
        notificationTopicArn: string;
        periodSeconds?: number;
    }

    Hierarchy (View Summary)

    Index

    Properties

    accountTotal?: TokenThresholdsProps

    Token-use alarms on the account-wide total across all model IDs.

    Use cases: overall token-spend alerting without enumerating models

    AWS: CloudWatch alarms on the undimensioned AWS/Bedrock InputTokenCount / OutputTokenCount

    Validation: Optional; TokenThresholdsProps

    datapointsToAlarm?: number

    Number of breaching periods within evaluationPeriods required to alarm (an "M of N" alarm).

    Use cases: ignoring a single burst while catching sustained token use

    AWS: CloudWatch alarm datapointsToAlarm

    Validation: Optional; Number; between 1 and evaluationPeriods

    evaluationPeriods
    

    integer

    1

    evaluationPeriods?: number

    Number of periods over which token use is compared to the threshold.

    Use cases: requiring sustained token use before alarming

    AWS: CloudWatch alarm evaluation periods

    Validation: Optional; Number; periodSeconds x evaluationPeriods at most 86400 for a period under 3600, at most 604800 otherwise

    1
    

    integer

    1

    Token-use alarms per model, keyed by a name for the model. Each entry lists every model and inference-profile ID callers use for that model.

    Use cases: per-model token-spend alerting

    AWS: CloudWatch alarms on AWS/Bedrock token metrics by ModelId

    Validation: Optional; NamedModelTokenAlarmProps

    notificationTopicArn: string

    ARN of an existing SNS topic to notify on alarm. Mutually exclusive with createNotificationTopic.

    MDAA cannot verify or modify a topic it did not create: the topic should be encrypted with a customer-managed KMS key, must allow the cloudwatch.amazonaws.com service principal to sns:Publish (and to use that key), and needs at least one subscriber. MDAA emits a synth-time warning restating this.

    Use cases: routing alarms to an existing operations or cost topic

    AWS: SNS topic ARN used as the CloudWatch alarm action

    Validation: Required; String; valid SNS topic ARN; mutually exclusive with createNotificationTopic

    periodSeconds?: number

    Alarm period in seconds. Each period's token count is compared to the threshold.

    Use cases: matching the alarm window to the token budget's granularity

    AWS: CloudWatch alarm period

    Bedrock publishes token metrics at one-minute resolution, so the period is a whole number of minutes.

    Validation: Optional; Number; multiple of 60; periodSeconds x evaluationPeriods at most 86400 for a period under 3600, at most 604800 otherwise

    300
    

    integer

    60

    60