Skip to content

openaddresses/batch-alarms

Repository files navigation

batch-alarms

Library for providing default CloudFormation dashboards & ECS Services

https://openaddresses.github.io/batch-alarms

Installation

npm add batch-alarms

Usage

Notifying an Email

import cf from '@openaddresses/cloudfriend';
import {
    ELB as ELBAlarms,
    RDS as RSDAlarms
} from 'batch-alarms';

cf.merge(
    template,
    ELBAlarms({
        prefix: 'CFPrefix',
        apache: cf.stackName,
        email: '[email protected]',
        cluster: cf.ref('APIECSCluster'),
        service: cf.getAtt('APIService', 'Name'),
        loadbalancer: cf.getAtt('APIELB', 'LoadBalancerFullName'),
        targetgroup: cf.getAtt('APITargetGroup', 'TargetGroupFullName'),
    }),
    ELBAlarms({
        prefix: 'CFPrefix',
        email: '[email protected]',
        targetgroup: cf.ref('RDSInstance')
    })
);

Notifying an Existing SNS Topic

import cf from '@openaddresses/cloudfriend';
import {
    ELB as ELBAlarms,
    RDS as RSDAlarms
} from 'batch-alarms';

cf.merge(
    template,
    ELBAlarms({
        prefix: 'CFPrefix',
        apache: cf.stackName,
        topic: cf.ref('ExistingTopic'),
        cluster: cf.ref('APIECSCluster'),
        service: cf.getAtt('APIService', 'Name'),
        loadbalancer: cf.getAtt('APIELB', 'LoadBalancerFullName'),
        targetgroup: cf.getAtt('APITargetGroup', 'TargetGroupFullName'),
    }),
    ELBAlarms({
        prefix: 'CFPrefix',
        topic: cf.ref('ExistingTopic'),
        targetgroup: cf.ref('RDSInstance')
    })
);

About

Library for providing default CloudFormation dashboards & ECS Services

Resources

License

Stars

Watchers

Forks

Packages

No packages published