Skip to main content

npm peer dependency version (scoped) npm (scoped) PyPI

@spacecomx/cdk-billing-alarm

A CDK construct to monitor estimated billing charges with alerts and notifications. It sets up an estimated monthly billing alarm associated with an email address endpoint. It then subscribes an email endpoint to an SNS Topic or an existing SNS Topic Arn.

The construct can be used to implement multiple customizable billing alarms for master/payer accounts e.g (AWS Organization). For customizable multi-account billing alarm requirements, see @spacecomx/cdk-organization-billing-alarm

Features

Some features built-in:

  • consolidated charge estimates of all AWS services in your AWS account.
  • associate the billing alarm with an existing SNS topic Arn in your AWS account.
  • consolidated charges for a specific AWS service used by your AWS account e.g. Amazon DynamoDB.
  • consolidated charges for all linked accounts within the master/payer account e.g. AWS Organization.
  • consolidated charges for linked account within a master/payer account.
  • consolidated charges for linked account and AWS service within the master/payer account.

Prerequisites

⚠️ Before you can create a billing alarm, you must enable billing alerts in your account, or the master/payer account if you are using consolidated billing. For more information, see Enabling Billing Alerts.

Installation

TypeScript/JavaScript:

npm i @spacecomx/cdk-billing-alarm

or:

yarn add @spacecomx/cdk-billing-alarm

Python:

pip install spacecomx.cdk-billing-alarm

Example: Create a billing alarm in your AWS account

This type of billing alarm configuration will provide estimated charges for every AWS Service that you use, in addition to the estimated overall total of your AWS charges within your AWS account. For more advanced examples and custom implementations, see documentation.

🔸 The emailAddress is an endpoint that subscribes to a SNS topic. The thresholdAmount is the amount in USD, that will trigger the alarm when AWS charges exceed the threshold.

# Example automatically generated without compilation. See https://github.com/aws/jsii/issues/826
from aws_cdk.core import Stack, StackProps
from spacecomx.cdk_billing_alarm import BillingAlarm, BillingAlarmProps

class BillingAlarmStack(Stack):
    def __init__(self, scope, id, *, description=None, env=None, stackName=None, tags=None, synthesizer=None, terminationProtection=None, analyticsReporting=None):
        super().__init__(scope, id, description=description, env=env, stackName=stackName, tags=tags, synthesizer=synthesizer, terminationProtection=terminationProtection, analyticsReporting=analyticsReporting)

        options = {
            "topic_configuration": {
                "email_address": ["john@example.org"]
            },
            "alarm_configuration": {
                "alarm_description": "Consolidated Billing Alarm - All AWS Services",
                "threshold_amount": 150
            }
        }

        BillingAlarm(self, "BillingAlarm", options)

Documentation

For more advanced examples and custom implementations, see documentation

API Documentation

For more detail, see API documentation

Contributions

Contributions of all kinds are welcome! Check out our contributor's guide and our code of conduct

Credits

Alternatives

License

@spacecomx/cdk-billing-alarm is distributed under the MIT license.

Metadata

Release files for spacecomx.cdk-billing-alarm 1.0.20

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for spacecomx.cdk-billing-alarm 1.0.20
File Size Uploaded
spacecomx.cdk-billing-alarm-1.0.20.tar.gz 41.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for spacecomx.cdk-billing-alarm 1.0.20
File Interpreter ABI Platform
spacecomx.cdk_billing_alarm-1.0.20-py3-none-any.whl Python 3 none any Details

Total release size: 81.0 kB

Release files / spacecomx.cdk-billing-alarm-1.0.20.tar.gz

Download URL spacecomx.cdk-billing-alarm-1.0.20.tar.gz
Size 41.0 kB
Tags Source
SHA-256 checksum
How to use checksums
1ae9e26fee79010e4845b2287a8c9b630b025ccd45a9ca126aa41c57ec629ad9
BLAKE2b-256 checksum
How to use checksums
9fa2b4644693e640edb4c7beb9f0a474c5d177e37318a8aad33b50731a13eb33
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.2 importlib_metadata/4.6.4 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.1 CPython/3.7.10

Release files / spacecomx.cdk_billing_alarm-1.0.20-py3-none-any.whl

Download URL spacecomx.cdk_billing_alarm-1.0.20-py3-none-any.whl
Size 40.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
63e9ee7543f60f04d619fdf8569540ff8ce4dd860b67aa1a9fa4ff928ac630f3
BLAKE2b-256 checksum
How to use checksums
e889f2c237cf3507be8b8f79f7bd65a1ce7ae3f5068eb959cd64496f8c1ef5e6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.2 importlib_metadata/4.6.4 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.1 CPython/3.7.10

Release history Release notifications | RSS feed

This release

1.0.20 This release

2 release files

1.0.17

2 release files

1.0.16

2 release files

1.0.15

2 release files

1.0.13

2 release files

1.0.12

2 release files

1.0.11

2 release files

1.0.10

2 release files

1.0.9

2 release files

1.0.8

2 release files

1.0.7

2 release files

1.0.6

2 release files

1.0.5

2 release files

1.0.4

2 release files

1.0.3

2 release files

1.0.2

2 release files

0.0.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page