Skip to main content

It sets up an estimated monthly billing alarm associated with an email address endpoint. It then subscribes that endpoint to an SNS Topic created by the package or it can use an existing SNS Topic Arn. The CDK construct can be used to implement multiple customizable billing alarms for single or master/payer account e.g (AWS Organization).

Project description

npm version PyPI version

@spacecomx/cdk-billing-alarm

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

:warning: 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.

:small_orange_diamond: 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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

spacecomx.cdk-billing-alarm-1.0.14.tar.gz (40.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

spacecomx.cdk_billing_alarm-1.0.14-py3-none-any.whl (39.7 kB view details)

Uploaded Python 3

File details

Details for the file spacecomx.cdk-billing-alarm-1.0.14.tar.gz.

File metadata

  • Download URL: spacecomx.cdk-billing-alarm-1.0.14.tar.gz
  • Upload date:
  • Size: 40.7 kB
  • Tags: Source
  • Uploaded using 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

File hashes

Hashes for spacecomx.cdk-billing-alarm-1.0.14.tar.gz
Algorithm Hash digest
SHA256 ba4e59a8debe42db61a4b5f225e6c7fe64ae824d1f6084ed858c962e0ea491ca
MD5 93ce671de93cc31ce6202cfb582eb726
BLAKE2b-256 f93fbb486ba1ddda726a32b7c3b892cc33586d90168d260fdfb7bda1d46bd3ed

See more details on using hashes here.

File details

Details for the file spacecomx.cdk_billing_alarm-1.0.14-py3-none-any.whl.

File metadata

  • Download URL: spacecomx.cdk_billing_alarm-1.0.14-py3-none-any.whl
  • Upload date:
  • Size: 39.7 kB
  • Tags: Python 3
  • Uploaded using 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

File hashes

Hashes for spacecomx.cdk_billing_alarm-1.0.14-py3-none-any.whl
Algorithm Hash digest
SHA256 f7a2e2bcde659de47c2daa65eb793ce895bda714b87f6dd0c3bd876137e56df3
MD5 c162f455c31110a06ef8e00944999549
BLAKE2b-256 f073b87fda7da9030c72dc91f5ec75181473f7fff9bd0086cc706b4c14778a1a

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page