How to calculator cost per month in AWS SDK? - node.js

I want to use nodejs to calculate the cost and billing each month for my users in AWS.
However, I could not find SDK support to get cost and billing information each month.

There are some node.js sdk available under Budgets section. See if you can use these api's to cater to your needs.
http://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/Budgets.html

AWS supports programmatic access to billing data. Basically you assign an S3 bucket and then parse the CSV log files that billing generates.
Programmatic Access to AWS Billing Data
API Reference

Related

AWS boto3 billing information

I'm looking for a way to extract billing information using boto3. I've seen solutions using cost explorer but it's not a choice in my case. The information I want to extract is on Billing Dashboard > Bills. Is there a service on boto3 that facilitates this task?
I found a solution, using boto3. Using the CloudWatch client we can extract Billing metrics for any service we want:
Monitor Estimated Charges with CloudWatch
CloudWatch.Metric.get_statistics

how to find ServiceName in Azure Cloud billing export

In Azure Cost analysis console, we have the option to filter by Service Name. The same Column is NOT there in the billing CSV export I’m getting from Azure. Does anyone know how to filter Service name in billing export
I tried to see cost analysis in 'Cost Management + Billing | Billing account' menu, and I also found the downloaded CSV files don't contain an Service Name column. So I prefer to use cost management api to get the details.
Here's the api link: https://learn.microsoft.com/en-us/rest/api/cost-management/query/usage
By the way, I remembered that if someone wanna use this api, please make sure that the target subscription has joined Azure plan.
Hope it will do some help. Wish you a good day.

Is there any way to get Savings info of spot instance by AWS CLI

I googled but can't find it. Can we obtain the spot usage and savings info in Savings tab on Spot instance by AWS CLI?
Yes and No.
General pricing information is available via Using the AWS Price List API - AWS Billing and Cost Management
Current spot prices are available via DescribeSpotPriceHistory - Amazon Elastic Compute Cloud
You would need to calculate the difference yourself.

Rackspace and Microsoft Azure pricing api

Is there a public api for getting pricing lists of Rackspace and Microsoft Azure in JSON format?
Have been searching for that but could not find any information.
Thank you in advance.
For Rackspace, there is not a public API for getting pricing lists in JSON format. You can find a list of the prices for Cloud Servers here if you scroll down to the "pricing" section: http://www.rackspace.com/cloud/servers
You can select a class of OS, service level, and whether you want the prices to be displayed hourly or monthly. Rackspace doesn't offer cloud servers without a support plan, so you'll need to factor that into your calculations. With the DevOps support plan, you'll need to factor in the volume discount for large numbers of servers.
There's also a price calculator here: http://www.rackspace.com/calculator
(Disclaimer: I work at Rackspace.)
For Azure, this may help.
I was looking for the same thing and stumble upon this post on stack overflow: Azure pricing calculator api. I was able to generate JSON string using this git hub repo: https://github.com/Azure-Samples/billing-dotnet-ratecard-api.
Hope this helps!

Custom meter API on Azure

Is there an easy way to count calls, or specific items within a call in Azure?
If not, is there an easy way to count the amount of data transferred to the cloud service?
The data-transfer-In\out for a cloud service will be part of monthly Azure bill. There is an API available for Enterprise Azure customers (https://automaticbillingspec.blob.core.windows.net/spec/UsageDownloadRestfulSampleClient.zip) but not yet for Credit Card (CC) Customers\non-EA. For CC customer the bill is downloadable as CSV from the management portal

Resources