npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@spacecomx/cdk-billing-alarm

v1.0.20

Published

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 c

Downloads

23

Readme

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

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

import { Stack, StackProps } from '@aws-cdk/core';
import { BillingAlarm, BillingAlarmProps } from '@spacecomx/cdk-billing-alarm';

export class BillingAlarmStack extends Stack {
  constructor(scope: Construct, id: string, props: StackProps) {
    super(scope, id, props);

    const options: BillingAlarmProps = {
      topicConfiguration: {
        emailAddress: ['[email protected]'], // required
      },
      alarmConfiguration: {
        alarmDescription: 'Consolidated Billing Alarm - All AWS Services',
        thresholdAmount: 150, // required
      },
    };

    new BillingAlarm(this, '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.