What do you mean? I always have an idea of monthly costs of any resource before I provision it. If anything is priced hourly I’ll just multiply by 730 to get monthly max.
The hardest thing to predict is egress, so just estimate it at worst case of 9 cents a GB.
These days I use Q Developer and give it read-only access to my billing account for additional context (enterprise discounts, etc). I use Terraform almost exclusively, but should have largely the same experience with CDK at least if you tell it to use the synthesized CloudFormation rather than the raw CDK.
Give the AI context such as expected traffic estimates, etc. Ask it to factor in your enterprise discounts, exclude free-tier reductions (likely don’t factor in for anything but the smallest orgs), etc. AI can itemize your resources, sub resources, bandwidth estimates, etc in far more comprehensive and accurate detail than most any human is likely to bother spending the effort to do and it’ll get the job done in a few minutes.
Screw the cost estimator (tedious, error prone, etc), screw the 3rd party tools (same + cost money) and just let your AI loose on the problem. Works a peach.
funny coincidence! this is the exact problem I had a month ago and couldn’t find a good solution for, so I built a GitHub app called CloudBurn to solve it. It literally just got approved a week ago by github for letting me publish it in the official GitHub Marketplace.
the app is pretty straightforward, you run cdk diff, save it to a file, feed it to this github action, and it automatically posts a cost report as a PR comment before you merge and deploy to production. it only needs the cdk diff output as input so it’s non-intrusive to your workflow.
it’s free to use right now while i’m beta testing with more users, and i’ll always keep a free tier available.
for the “cost surprises” thing you mentioned, the biggest gotchas are usually data transfer costs, NAT gateway hours, and per-request pricing that scales with actual usage. automated diff analysis catches the obvious mistakes (like accidentally spinning up 10 NAT gateways instead of 1) but won’t predict usage-based costs without knowing your traffic patterns. i do have an idea on how to support that but need more feedback from users to get it right before implementing it. dev account testing is still valuable for now, but having automated feedback in PRs has saved me from some expensive mistakes.
happy to answer questions if you want to try it out!
it does now I ran into the same issue as OP and developed a github app which got published last week that parses your cdk diff output and it will spit out a cost report based on the infrastructure changes. It currently supports both cdk and terraform
you need to understand the services you are using anyway, right? the question comes up as: i need a key-value store. what options do i have? dynamodb, s3. efs maybe. ec2 based stuff. rds. when you choose a service, no doubt one of the factors is to understand the pricing.
once you did the homework, you can just know what are the few cost items that will dominate your bill. it is really lopsided, there will be half a dozen that makes the needle move, the others will be peanuts.
now, if you use a service without researching its offerings first, then what are you really expecting? and what are you really doing?