Skip to content
Lambda Function that plot AWS Reserved Utilization/Coverage
Go Makefile
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.github/workflows
configs
dst
pkg
src
testdata
.gitignore
LICENSE
Makefile
README.md
go.mod
go.sum
logo.png
template.yaml

README.md

logo

GoDoc license Go Report Card codecov

This project provides an AWS Lambda application that created and deployed by Serverless Framework for the following purpose:

  • Plot below metrics of your AWS Accounts to Datadog using cross-account access by AssumeRole
    • AWS Reserved Instance Utilization
    • AWS Reserved Instance Coverage

Preparation

Set Role

Change Role to your role arn in template.yaml.

To assume a role from a different account, your AWS account must be trusted by this role.

arn:aws:iam::123456789012:role/original

In other account, create and add the above role arn to below role's trusted entity.

arn:aws:iam::<cross account id>:role/stsMonitor

Change below line if you want to change role name in cross account

  • pkg/awsapi/sts.go
fmtRoleArn         = "arn:aws:iam::%s:role/stsMonitor"

Set SSM Parameter store with description in account which the assume role belongs to

  • datadog_api_key
  • datadog_app_key

Invoke Lambda Function in Local

make local-invoke

Deploy Lambda Function

make deploy

Invoke Lambda Function

aws lambda invoke --function-name ri-utilization-plotter --log-type Tail out.log

LICENSE

MIT License

Note

Icon made by bqlqn from www.flaticon.com

You can’t perform that action at this time.