Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cost Estimation Tools #70

Closed
eladb opened this issue Jul 11, 2018 · 10 comments
Closed

Cost Estimation Tools #70

eladb opened this issue Jul 11, 2018 · 10 comments
Labels
effort/medium Reasonable effort required for implementation status/stale The RFC did not get any significant enough progress or tracking and has become stale.

Comments

@eladb
Copy link
Contributor

eladb commented Jul 11, 2018

Some ideas around cost estimation:

  1. Calculate fixed cost based on a CloudFormation template (aws cloudformation estimate-template-cost)
  2. Auto-tag all resources in a construct/stack and use the pricing APIs to track variable cost as well, so users can add constructs that alarm if costs has gone too high or even auto-destroy?)
@ccfife
Copy link
Contributor

ccfife commented Jul 19, 2018

perhaps a "what-if" switch in the CDK CLI that estimates the cost of the stack?

@pfeilbr
Copy link

pfeilbr commented Sep 4, 2019

I feel like this is the last concern/barrier to entry to address with CDK. You've demonstrated, provisioning, efficiency, and observability. The last "big"/"unknown" concern always lurking is cost. Do a best estimate default, but then allow a parameterized estimate based on traffic, rps, etc. I know ... easier said than done. The team has essentially uncovered all the unknowns in the other spaces, but cost to run could use some love :)

E.g. request to API Gateway endpoint, trace service usage (x-ray) (relevant CloudWatch metrics, etc.), understand cost of it, extrapolate to an estimate. This cost estimator is part of the deployed stack, always runs, and provides better cost estimates with time (aws [sagemaker|forecast] it based on usage data). As noted, pricing APIs include "forecasted" cost estimation based on usage. Use the same filtered by stack tags to constrain the estimates.

As a first step and convenience deploy option, you could just generate the billing report as part of the stack.

@vaneek
Copy link

vaneek commented Sep 4, 2019

IIRC there where some tools elsewhere in the AWS ecosystem to estimate costs based on cfn templates. I haven’t explored them lately and at the time thought they where deficient and not very usable in an everything-as-code setting.

My opinion is that the cost estimation should not be part of a framework or sdk but rather a service with a standard API. A framework such as CDK could then provide some CLI options or tools to call the service.

For example call an api and pass a cfn template and get back an estimate or budget report.

@eladb eladb transferred this issue from aws/aws-cdk Jan 23, 2020
@eladb eladb added the effort/medium Reasonable effort required for implementation label Jan 23, 2020
@eladb eladb removed their assignment Jun 22, 2020
@eladb eladb changed the title Cost estimation tools Cost Estimation Tools Jun 23, 2020
@eladb eladb added the status/proposed Newly proposed RFC label Jun 23, 2020
@gabrielenosso
Copy link

Just wanted to mention that in the https://github.com/aws/aws-cdk-rfcs there are 2 proposal for a Cost Estimation Tool / Cost Calculator.

Numbers 70 (this one) and 22.

@master-harvey
Copy link

master-harvey commented Jun 24, 2023

We can tag all taggable resources in a stack using the tags prop in the Stack object constructor. You can then go to Cost Explorer in the console and filter by tag to track actual usage costs.

I haven't tried this yet but it looks like the CloudFormation CLI already has a way to get an estimate ahead of time:
https://awscli.amazonaws.com/v2/documentation/api/latest/reference/cloudformation/estimate-template-cost.html

@evgenyka evgenyka mentioned this issue Aug 10, 2023
7 tasks
@spoco2
Copy link

spoco2 commented Sep 18, 2023

We're using CDK, we have a number of stacks we deploy, we're at early stages of our start up and only have testing data loads through the system so far.

Manually trying to work out the cost of this system as we scale load is hugely difficult and massively time consuming due to the multitude of ways that each part of the system has different cost models applied by AWS, and different pricing breakpoints based on usage volumes.

So, being able to point a tool at a CDK stack (or collection of stacks more realistically) and then have access to sliders/inputs to alter the volume through the system/time used etc. and get projected costs out would be massively useful.

5 years on since this was opened and other issues rolled into it, and still no viable tool is very disappointing.

"Go and use Cost Explorer in the console, it has forecasting" is a useless thing that gets said a lot around the traps, as that assumes you already have a system that has had production loads running against it, and then all it'll do is assume some growth against that.

Gives no ability to change volumes, usage, anything.

This all makes it very hard to estimate the cost of AWS expenditure for startups.

@ahammond
Copy link

ahammond commented Nov 8, 2023

We are looking for a way to put an estimated cost delta into our PRs. My take on this is that it might possibly be part of Cfn, but is almost certainly not part of CDK. If it's not part of Cfn, then it's probably some external integration which would be managed for PRs by projen.

@awsmjs
Copy link
Contributor

awsmjs commented Dec 14, 2023

Closing this ticket. We don't have the bandwidth to collaborate on design or implementation. We suggest experimentation for this feature first via a separate package or a fork if needed. If a successful implementation emerges, reopen the proposal with details on the functionality and how it can be implemented in the core library.

@awsmjs awsmjs closed this as completed Dec 14, 2023
@ahammond
Copy link

Fair enough. Can you suggest who we should be talking to about this?

@mrgrain mrgrain added status/stale The RFC did not get any significant enough progress or tracking and has become stale. and removed status/proposed Newly proposed RFC labels Dec 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
effort/medium Reasonable effort required for implementation status/stale The RFC did not get any significant enough progress or tracking and has become stale.
Projects
None yet
Development

No branches or pull requests

11 participants