Skip to content

Latest commit

 

History

History
70 lines (58 loc) · 1.56 KB

README.md

File metadata and controls

70 lines (58 loc) · 1.56 KB

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')
    })
);