Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Consider temporary instances #26

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
This is just the first and most simple version of an account wide resource utilization metric & dashboard, to get overall
insights on actually how much room for optimization is available.

As a baseline, initial version considers only Amazon EC2 service CPU Utilization.
As a baseline, initial version considers only [Amazon EC2](https://aws.amazon.com/ec2/) service [CPU Utilization](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/monitoring_ec2.html).

## Requirements
* Setup AWS credentials for your environment: [instructions here](https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-files.html)
Expand All @@ -15,16 +15,16 @@ As a baseline, initial version considers only Amazon EC2 service CPU Utilization

## Deployment

Inside your terminal, execute `deploy.sh` to pack and deploy the `template.yaml` AWS CloudFormation template:
Inside your terminal, execute `deploy.sh` to pack and deploy the `template.yaml` [AWS CloudFormation](https://aws.amazon.com/cloudformation/) template:

`./deploy.sh`

## Usage

This template includes an AWS Step Function that orchestrates the whole metric gathering and aggregation process.
It is triggered daily via an Amazon EventBridge rule, so that no manual intervention is needed to process the data.
This template includes an [AWS Step Function](https://aws.amazon.com/step-functions/) that orchestrates the whole metric gathering and aggregation process.
It is triggered daily via an [Amazon EventBridge](https://aws.amazon.com/eventbridge/) rule, so that no manual intervention is needed to process the data.

Statistical data is stored per region as Amazon CloudWatch metrics and displayed in an Amazon CloudWatch Dashboard
Statistical data is stored per region as [Amazon CloudWatch metrics](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/working_with_metrics.html) and displayed in an [Amazon CloudWatch Dashboard](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch_Dashboards.html)
available for your analysis.

![Sample Dashboard](assets/dashboard-screenshot.png)
Expand Down
1 change: 1 addition & 0 deletions src/lambdas/GetInstanceUtilization/index.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ async function getInstanceUtilization (event) {
const command = new GetMetricDataCommand(params)
const response = await client.send(command)
console.log(JSON.stringify(response))
// TODO Check if results need pagination
for (const res of response.MetricDataResults) {
count += res.Values.length
for (const val of res.Values) {
Expand Down