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
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.
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
fmtRoleArn = "arn:aws:iam::%s:role/stsMonitor"
Set SSM Parameter store with description in account which the assume role belongs to
Invoke Lambda Function in Local
Deploy Lambda Function
Invoke Lambda Function
aws lambda invoke --function-name ri-utilization-plotter --log-type Tail out.log
Icon made by bqlqn from www.flaticon.com