High level 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 the endpoint to an SNS Topic or an existing SNS Topic Arn.
Project description
@spacecomx/cdk-billing-alarm
High level 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 the endpoint to an SNS Topic or an existing SNS Topic Arn.
The CDK construct can be used to implement multiple customizable billing alarms for single or master/payer linked AWS accounts e.g (AWS Organisations). Customizing the billing alarm gives you the capability to monitor specific AWS Service charges, by specific linked AWS account in a master/payer account.
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 a specific linked account within a master/payer account.
- consolidated charges for a specific AWS service and linked account 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
Setup basic 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. See documentation for more examples and custom implementations.
:small_orange_diamond: The
emailAddress
is an endpoint that subscribes to a SNS topic. ThethresholdAmount
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": "Billing alarm alert for all account AWS services",
"threshold_amount": 150
}
}
BillingAlarm(self, "BillingAlarm", options)
Documentation
See documentation for more examples and custom implemenations.
API Documentation
See API documentation for details.
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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for spacecomx.cdk-billing-alarm-1.0.5.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7f20fb522d5b3790ffd4c7be247a78f52cfc5b2b32926fe9c03b4b82a56d6470 |
|
MD5 | 3fc66a3a5e8d4a8159fb1d9ce95eb9c6 |
|
BLAKE2b-256 | 99b2db8103131ee0cb7baa463a7d5b98cb87836ab01e484e0c82a87aa6936296 |
Hashes for spacecomx.cdk_billing_alarm-1.0.5-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d743b4a7178745b7ecffc627f33268f1817db7832a3383cb80418a26288fb264 |
|
MD5 | fb7c8db5c5cf84e87e9e56f7285aaed4 |
|
BLAKE2b-256 | cee162ac7ea85d4cfcea22ea82007fdfc1e1b2b152da473194626b05d76c9bc1 |