Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/rafalwilinski/cloudwatch-public-metrics

Expose AWS Cloudwatch Metrics as a public HTML page using AWS Lambda and server-side rendering
https://github.com/rafalwilinski/cloudwatch-public-metrics

aws aws-cloudwatch aws-lambda metrics nodejs server-side-rendering serverless serverless-framework

Last synced: 23 days ago
JSON representation

Expose AWS Cloudwatch Metrics as a public HTML page using AWS Lambda and server-side rendering

Awesome Lists containing this project

README

        

# ![Logo](assets/logo.png "cloudwatch-public-metrics")

[![serverless](http://public.serverless.com/badges/v3.svg)](http://www.serverless.com)

Expose AWS Cloudwatch Metrics as a public HTML page using AWS Lambda and server-side rendering, for free. Inspired by [Yan Cui's](https://github.com/theburningmonk) [concept](https://pbs.twimg.com/media/DXmrxJQXcAAGxGB.jpg:large) & [status.github.com](status.github.com)

![Demo](assets/demo.png "demo")

## Demo

[Todo - my AWS account estimated charges](https://yvuuhi6gyg.execute-api.us-east-1.amazonaws.com/dev/)

## Usage
First, ensure that you have [Serverless Framework](serverless.com) installed. If not, install it:

```sh
$ npm install serverless -g
```

Clone the repo, install dependencies and deploy function:

```
$ git clone https://github.com/RafalWilinski/cloudwatch-public-metrics
$ npm install
$ npm run deploy
```

## Config
cloudwatch-public-metrics can be configured in two ways:

1. Using `config.yml` file:
```
METRIC_NAME: *required*
METRIC_TITLE:
METRIC_DURATION: *required*
METRIC_STATISTIC: *required*
METRIC_DIMENSIONS:
METRIC_SUFFIX:
USAGE_PLAN:
```

2. Using CLI flags:
```sh
$ npm run deploy -- \
--metricName AWS/Billing//EstimatedCharges \
--metricTitle Estimated\ Charges \
--metricDuration 15\ days \
--metricStatistic Average \
--metricDimensions Currency\=USD \
--metricSuffix \$
```
## Development

```sh
AWS_REGION=us-east-1 npm run watch
```

## License
MIT © [Rafal Wilinski](http://rwilinski.me)

### Credits
Logo by [Dinosoft Labs](https://thenounproject.com/dinosoftlabs/)