Programmatically get cloud spending/balance for AWS Lambda

186 Views Asked by At

Is there a way to get current status from an AWS account either through AWS cli or programmatically?

I am conducting some research in relation to FaaS and would like to get and log the cost after each experiment but haven't been able to find a solution for this.

Would really appreciate if somebody could point me in the right direction here :)

Thanks

1

There are 1 best solutions below

0
On

You can access the AWS Cost Explorer Service with the Cost Management API.

Also, here is an example of a fully fledged reporting tool written in Python.

But be aware that those AWS Cost Management API calls also incur costs ($0.01 per report) that are most likely higher than the AWS Lambda costs itself:

Lambda costs: $0.20 per 1M requests + $0.0000166667 for every GB-second