How can I estimate AWS costs programmatically for multiple services?
Asked by
CuriousCoder99
I'm working on a project that will utilize over 25 AWS services, including ECS, ECR, Fargate, EC2, DynamoDB, SQS, S3, Lambda, and VPC. I want to estimate my monthly costs in detail. For instance, I know how many read and write units I'll be using for DynamoDB with the pay-per-request billing mode. My goal is to input all this information programmatically and calculate the costs, ideally using Python or Golang. Is there a library available that can help me do this?
Answers
There are also methods using MCP servers that interface with billing APIs, where community members can help analyze architecture through tools like Terraform or CDK to estimate pricing.
Reply to this answer
Honestly, estimating AWS costs programmatically can be quite complicated. Itโs tough to get an accurate picture without a lot of detailed info about your exact resource usage and billing nuances.
Reply to this answer
Hi there! We actually have a Pricing API that can assist you in calculating costs programmatically for multiple services. If you're working with Python, the AWS SDK (boto3) includes a dedicated pricing service. It enables you to retrieve real-time pricing details and estimate costs based on projected usage. Check out the resources and examples here: https://go.aws/4lZ5Z63
Reply to this answer
If you're using Terraform or similar deployment tools, you might want to look at Infracost. It gives a preview of costs based on the resources you plan to deploy before you actually apply them, which could be very helpful for your project.
Reply to this answer
There's no straightforward library that covers everything due to the complexity of AWS pricing. AWS does offer public APIs to access real-time pricing data, but you need to know precisely what services and units you will be using. Consider checking out the price list API endpoint for the specific services you're interested in. Just keep in mind that calculating costs can get a bit detailed, especially with certain billing structures that mix usage and resource uptime.
Reply to this answer
Add your answer
Answers are reviewed before publication.
Related Discussions