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

@mhlabs/cfn-alarms-cli

v1.0.3

Published

Tool for creating CloudFormation alarms based on the resources in a CloudFormation/SAM template

Downloads

3

Readme

cfn-alarms-cli

Tool for creating CloudFormation alarms based on the resources in a CloudFormation/SAM stack template.

Why?

This is an effort to create a baseline of CloudFormation alarms for CloudFormation stacks. The intention is to save developers' time by providing a fast way to create alarms that follow some good practices so they can focus on building features rather than managing monitors.

Demo

demo

Usage:

1. Point the tool at your CloudFormation or SAM template.

cfn-alarms -t <template.yaml>

The tool will list the resource types that it has alarm templates for. It currently supports the following types, with more to follow:

  • AWS::Lambda::Function / AWS::Serverless::Function
    • Error rate and error count
  • AWS::DynamoDB::Table / AWS::Serverless::SimpleTable
    • User and system errors count
  • AWS::ApiGateway::RestApi / AWS::Serverless::Api
    • Apdex score, HTTP error rate and error count
  • AWS::StepFunctions::StateMachine / AWS::Serverless::StateMachine
    • Success rate < 99%
  • AWS::SQS::Queue
    • Queue depth
? Select resource types (Press <space> to select, <a> to toggle all, <i> to invert selection)
❯◯ AWS::Serverless::Function
 ◯ AWS::DynamoDB::Table
 ◯ AWS::SQS::Queue
 ◯ AWS::Serverless::SimpleTable
 ◯ AWS::ApiGateway::RestApi 

Select the resources you want to create alarms for.

2. Select the alarms you want to create.

The tool will list the available alarms for each resource type selected in step one. Select the ones you want to create.

? Select alarm(s) 
 ◯ ErrorsGreaterThanZero
❯◉ ErrorRate

3. Select how you want to be alerted.

? Select notification channel (Use arrow keys)
  None 
❯ Slack

If you select 'None' then you can build your own custom notification channel based on the alarm state change EventBridge events.

Selecting Slack will generate resources and permissions for EventBridge API Destinations targeting https://slack.com/api/chat.postMessage. You will need to create a Slack app and add its OAUTH2 token to SecretsManager under the key cfn-alarms-cli/slack-token like this:

{
  "Value": "xoxb-1234567890-your-slack-token-321"
}

Example output:

slack

4. Select the desired output format.

? Select output (Use arrow keys)
❯ Write to separate file (monitoring.yaml) 
  Append to template.yaml 

Selecting 'Write to separate file' will write the generated alarms to a file called monitoring.yaml in the current directory which will be included in the main template via Fn::Transform

Selecting 'Append to template.yaml' will append the generated alarms to the main template.