Is there any api available for AWS Pricing Calculator - amazon-web-services

Is there any api available for https://calculator.aws/#/ ?

There is no API for the AWS Pricing Calculator.
There is an AWS Price List API that can provide pricing for individual resources, but you would then need to multiply the individual costs based upon intended usage (eg 12 hours # $0.10 per hour).

Related

Why is Cloudwatch billing me for GetMetricData API calls in every regions? I run my app in a single region

I've been combing through my AWS bills and noticed something strange - Cloudwatch bills a very small amount for every available region with a charge it lists as $0.01 per 1,000 metrics requested using GetMetricData API - Asia Pacific (Singapore) (or insert region here).
In my main region (US East) I see billing as expected - a few bucks total for PutLogEvents and GetMetricData calls, as you'd expect from normal use.
But in every other region I also have these costs - a few cents each - for GetMetricData calls in that region. Does anybody know the source of these costs?
please take a look to https://aws.amazon.com/cloudwatch/pricing/?nc1=h_ls
The Costs for GetMetricData and GetMetricWidgetImage is not applicaple for the free tier, you will have on your AWS account.
Do you deploy something in your account, which collects data from all your regions or you did not restrict the values for those metrics? E.g. if you are using 3rd party services like NewRelic, Datadog, etc. and collect those metrics, this API call is used to receive the list of all available metrics.

Is it free to use the AWS Query API to get the prices of a service programmtically?

I am using the AWS Price List Query API to get only pricing for EC2 and EBS services.
Is it free to use the AWS Price List API?
Do I also need to create a new client for every pricing call?
Below is the code that I use:
AWSPricing pricing_client = AWSPricingClientBuilder.standard()
.withCredentials(new AWSStaticCredentialsProvider(new BasicAWSCredentials("mycredentials")))
.withRegion(Regions.US_EAST_1)
.build();
Is it free to use the AWS Price List API?
Yes, using the AWS Price List API is free of charge.
Other paid APIs like the AWS Cost Explorer API mention pricing & have been listed on AWS Cost Management Pricing as having a cost associated with them.
The Price List API is not on the pricing page, nor has a cost mentioned anywhere in the documentation so it is safe to assume that it is free (after all, you're just getting AWS's pricing data).
Do I also need to create a new client for every pricing call?
No, it isn't needed nor recommended.
Use the same pricing client for as many calls as needed.

Does AWS Sagemaker charges you per API request?

AWS pricing page describes how much it costs per hour to run AWS Sagemaker for online realtime inference.
https://aws.amazon.com/sagemaker/pricing/
But AWS usually also charges for API requests.
Do they charge extra per every API inference request to the Sagemaker model?
I am on the AWS SageMaker team. For "Real-Time Inference" you are only charged for:
usage of the instance types you choose (instance hours)
storage attached to those instance (GB storage hours)
data in and out of your Endpoint (Bytes in/out)
See "Pricing Example #6: Real-Time Inference" as well.

Is there an API for Amazon compute savings plan for amazon ec2?

Currently the ec2 instance savings plan rate can be retrieved through boto3's pricing client get_products(). However it does not seem to offer the compute savings plan rates.
Where in the API can I retrieve the compute savings plan rates?
Edit:
The describe_savings_plan_rates is not suitable as I want a non truncated value
There is indeed an API for savings plans, the functions are documented here.
And available in the Boto3 SDK here.
For the rates themselves you can use the describe_savings_plan_rates function.

best way to monetize aws API gateway + lambda + rds

selling an AWS API Gateway + lambda solution seems pretty straightforward as the customer is billed based on use.
In my case lambda writes data to an RDS DB which represents an hourly billed center of cost.
What would be a good way to fairly dispatch DB costs between different customers in such an application ?
Thanks
A very open ended question.
Simplest from customer point of view is it course in form of cost to use YOUR service. I.e. you don't wanna show a component/line-item called AWS RDS in your customers' bills.
AWS RDS seems pretty flat rate model (per machine). So unless you're setting up separate instances for each of your customer, I see 2 choices:
Flat tiered subscription. Where subscription gives you N free API calls.
Flat tiered subscription + per API call. Where subscription just gets you on board or gives you N free API calls and you pay a la carte for rest.
E.g your tiers are small, medium & large with a cap on TPS (API calls or sec) of say 5, 10 and 100 for a price of $5, $7 and $30 per month.
Customers who cross TPS for their tier, automatically can be charged for next tier.
Of course you can come up with many other combinations.
Should also add that if you're setting up separate instances for each of your customer then the distribution is pretty straightforward.