infracost / infracost Goto Github PK
View Code? Open in Web Editor NEWCloud cost estimates for Terraform in pull requestsπ°π Shift FinOps Left!
Home Page: https://infracost.io
License: Apache License 2.0
Cloud cost estimates for Terraform in pull requestsπ°π Shift FinOps Left!
Home Page: https://infracost.io
License: Apache License 2.0
EC2 monitoring price depends on the number of metrics for their instance types
https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/viewing_metrics_with_cloudwatch.html#ec2-cloudwatch-metrics
Here are the one's we seem to be missing:
Hello!
Using the latest 0.5.1
version, I got the following with a plan.json
file that I generated from a plan.save
(same workflow as described in the docs)
infracost --tfdir=. --tfjson=plan.json
β Calculating costsβ¦ panic: assignment to entry in nil map
goroutine 1 [running]:
github.com/infracost/infracost/pkg/schema.AddRawValue(0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x87d84f, 0x6, 0x7ef520, ...)
/home/runner/work/infracost/infracost/pkg/schema/resource_data.go:49 +0x106
github.com/infracost/infracost/internal/providers/terraform.parseResourceData(0x5, 0xc000270000, 0x48de2, 0x0, 0x0, 0x0, 0x0, 0x5, 0xc000296d2f, 0x45f, ...)
/home/runner/work/infracost/infracost/internal/providers/terraform/parser.go:64 +0x5c1
github.com/infracost/infracost/internal/providers/terraform.parsePlanJSON(0xc0001f0000, 0x48de2, 0x7fe00, 0x48de2, 0x7fe00, 0x0)
/home/runner/work/infracost/infracost/internal/providers/terraform/parser.go:32 +0x367
github.com/infracost/infracost/internal/providers/terraform.(*terraformProvider).LoadResources(0xc000099830, 0xc00010fd88, 0x2, 0x2, 0x0, 0x0)
/home/runner/work/infracost/infracost/internal/providers/terraform/provider.go:59 +0x75
main.main.func2(0xc0000bcf00, 0xc0000acf00, 0xe)
/home/runner/work/infracost/infracost/cmd/infracost/main.go:116 +0x253
github.com/urfave/cli/v2.(*App).RunContext(0xc000082900, 0x91f680, 0xc0000b4010, 0xc0000bc040, 0x4, 0x4, 0x0, 0x0)
/home/runner/go/pkg/mod/github.com/urfave/cli/[email protected]/app.go:315 +0x70b
github.com/urfave/cli/v2.(*App).Run(...)
/home/runner/go/pkg/mod/github.com/urfave/cli/[email protected]/app.go:215
main.main()
/home/runner/work/infracost/infracost/cmd/infracost/main.go:147 +0x4b0
I can provide the json file if it helps
Thanks !
I am trying to run infrascost
for some of my terraform resources and I am getting below error :
β infracost --tfdir terraform/
β Calculating costsβ¦ ERROR There are some problems with the configuration, described below.
ERROR
ERROR The Terraform configuration must be valid before initialization so that
ERROR Terraform can determine which modules and providers need to be installed.
ERROR
ERROR Error: Error parsing /karan/Desktop/terraform/data.tf: At 85:25: unexpected token while parsing list: IDENT
ERROR
ERROR
exit status 1
β
The code in data.tf
at line 85 is locals
defining some subnet id, etc. shown below:
locals {
private_subnets = [data.aws_subnet.private-1a-prod, data.aws_subnet.private-1c-prod, data.aws_subnet.private-1d-prod]
private_subnet_ids = local.private_subnets.*.id
private_subnet_azs = local.private_subnets.*.availability_zone
}
I am using terraform version 0.12.16
& aws provider version 2.51.0
Could you please help with this issue?
Following on from discussions with @sashman.
We can add the prices for Lambda initially, so at least we can see that this resource does have a price, and what the price is for different memory configurations. We can do this initially with something like this:
NAME QUANTITY UNIT PRICE PER UNIT HOURLY COST MONTHLY COST
aws_instance.web_app
ββ instance hours (t3.micro) 730 hour 0.0104 0.0104 7.5920
ββ root_block_device GB 15 GB/month 0.0021 0.0021 1.5000
Total 0.0125 9.0920
aws_lambda_function.test_lambda
ββ requests 1K 100ms request 0.0002 coming soon coming soon
Total coming soon coming soon
OVERALL TOTAL 0.0700 51.0670
In the future we can then work out the following to be able to show cost ranges:
We shall have a version flag, which outputs both the infracost version, and the current terraform version which infracost uses for that environemnt. That will come in handy and also all most all cli tools have, so people expect it to be there.
Hi @aliscott - first of all, great project and thanks for sharing it with the community.
We tried using infracost
in one of our projects and are getting the following errors. Let us know if there is anything else we can provide to help debug. We could also be using the tool wrongly to be fair :)
The infra we tested it against is not overly complex but it has a fair chunk of modules so it might be more than has been tested - not sure.
Generated plan files as following:
terraform plan --var-file=env/$(ENV)/vars.tfvars --out=plan.save
terraform show --json $(ENV)-plan.save > plan.json
Size of plan files - json plan file is about 13k lines
-rw-r--r-- 1 alexouzounis staff 429K 20 Jul 14:47 plan.json
-rw-r--r-- 1 alexouzounis staff 82K 20 Jul 14:47 plan.save
Commands executed, tried both ways:
β°β infracost --tfdir=. --tfplan=plan.save
INFO Running command: /usr/local/bin/terraform show -json olaf-plan.save
ERROR Error while reading from Writer: bufio.Scanner: token too long
signal: broken pipe
and
β°β infracost --tfdir=. --tfjson=plan.json
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x136d8c6]
goroutine 1 [running]:
infracost/internal/terraform/aws.(*Ec2AutoscalingGroup).PriceComponents(0xc0002c1400, 0x0, 0x0, 0x18271d8)
/Users/ali/src/infracost/internal/terraform/aws/ec2_autoscaling_group.go:105 +0x26
infracost/pkg/base.(*GraphQLQueryRunner).batchQueries(0xc0002f5280, 0x1535500, 0xc0002c1400, 0x1, 0xc00021c640, 0x1, 0x1, 0xc0002cc060, 0x0)
/Users/ali/src/infracost/pkg/base/query.go:91 +0x96
infracost/pkg/base.(*GraphQLQueryRunner).RunQueries(0xc0002f5280, 0x1535500, 0xc0002c1400, 0xc0002e4001, 0x78, 0x0)
/Users/ali/src/infracost/pkg/base/query.go:124 +0x5a
infracost/pkg/base.GenerateCostBreakdowns(0x152b0c0, 0xc0002f5280, 0xc000038600, 0x6, 0x8, 0xc00002c300, 0x30, 0x0, 0x18, 0xc00000ef00)
/Users/ali/src/infracost/pkg/base/costs.go:93 +0x636
main.main.func2(0xc000090b00, 0xc00000ef00, 0xe)
/Users/ali/src/infracost/cmd/infracost/main.go:129 +0x389
github.com/urfave/cli/v2.(*App).RunContext(0xc000001980, 0x1532ea0, 0xc000028080, 0xc0000201b0, 0x3, 0x3, 0x0, 0x0)
/Users/ali/go/pkg/mod/github.com/urfave/cli/[email protected]/app.go:315 +0x6be
github.com/urfave/cli/v2.(*App).Run(...)
/Users/ali/go/pkg/mod/github.com/urfave/cli/[email protected]/app.go:215
main.main()
/Users/ali/src/infracost/cmd/infracost/main.go:153 +0x5d1
Add to the usage section-
Replace the --tf-dir
value with your infra's path, or git clone this repository to check the examples
docker run --rm -v $PWD/:/code/ infracost/infracost:latest --tf-dir /code/examples/small_terraform
Currently the integrations tests take ~10 seconds each to run. This is because they are running terraform init
, terraform plan
and hitting the pricing.infracost.io service for each test.
There's various options to improve the performance. Some initial ideas:
terraform plan
outputsterraform init
and terraform plan
once when the tests run by somehow merging the tests into a single Terraform project.Hello,
Using latest infracost
, version 0.5.1
, I tried running the following to get estimated costs for an EKS cluster created using https://github.com/terraform-aws-modules/terraform-aws-eks (it's just a couple of wrappers on top of official Terraform EKS modules, AFAIK) - but I got an empty table with a cost of 0.
TF_CLI_ARGS_plan="-var-file=variables.tfvars -var cluster_name=${CLUSTER}" infracost --tfdir .
NAME MONTHLY QTY UNIT PRICE HOURLY COST MONTHLY COST
OVERALL TOTAL 0.0000 0.0000
Unfortunately, DEBUG
or even TRACE
logs don't help that much:
TF_CLI_ARGS_plan="-var-file=variables.tfvars -var cluster_name=${CLUSTER}" infracost --log-level=TRACE --tfdir .
INFO Running command: /usr/bin/terraform init
NAME MONTHLY QTY UNIT PRICE HOURLY COST MONTHLY COST
OVERALL TOTAL 0.0000 0.0000
Here is the state list result on the same Terraform directory:
# terraform state list
data.aws_eks_cluster.cluster
data.aws_eks_cluster_auth.cluster
data.aws_region.current
kubernetes_cluster_role.cluster_autoscaler
kubernetes_cluster_role_binding.cluster_autoscaler
kubernetes_deployment.cluster_autoscaler
kubernetes_role.cluster_autoscaler
kubernetes_role_binding.cluster_autoscaler
kubernetes_service_account.cluster_autoscaler
module.datasource.data.aws_caller_identity.current
module.datasource.data.aws_region.current
module.datasource.data.aws_security_group.eks-entrypoints
module.datasource.data.aws_subnet_ids.subnets
module.datasource.data.aws_vpc.shared_vpc
module.eks.data.aws_ami.eks_worker
module.eks.data.aws_ami.eks_worker_windows
module.eks.data.aws_caller_identity.current
module.eks.data.aws_iam_policy_document.cluster_assume_role_policy
module.eks.data.aws_iam_policy_document.workers_assume_role_policy
module.eks.data.aws_iam_role.custom_cluster_iam_role[0]
module.eks.data.aws_partition.current
module.eks.data.null_data_source.node_groups[0]
module.eks.aws_eks_cluster.this[0]
module.eks.local_file.kubeconfig[0]
module.eks.module.node_groups.aws_eks_node_group.workers["my-node"]
module.eks.module.node_groups.random_pet.node_groups["my-node"]
Interestingly enough, if I add a t2.micro, I'm gonna get some results:
resource "aws_instance" "example" {
ami = "ami-0e7767d1cb89be85d"
instance_type = "t2.micro"
}
TF_CLI_ARGS_plan="-var-file=variables.tfvars -var cluster_name=${CLUSTER}" infracost --log-level=TRACE --tfdir .
INFO Running command: /usr/bin/terraform init
NAME MONTHLY QTY UNIT PRICE HOURLY COST MONTHLY COST
aws_instance.example
ββ Compute (on-demand, t2.micro) 730 hours 0.0116 0.0116 8.4680
ββ Storage (root_block_device) 8 GB-months 0.1000 0.0011 0.8000
Total 0.0127 9.2680
OVERALL TOTAL 0.0127 9.2680
So all in all, I'm wondering if infracost
can estimate EKS costs ?
Looking at the GraphQL API (https://pricing.infracost.io/graphql) I can see EKS is there though:
query {
products(
filter: {
vendorName: "aws",
service: "AmazonEKS",
region: "ca-central-1"
},
) {
attributes { key, value }
prices { USD }
}
}
will return
{
"data": {
"products": [
{
"attributes": [
{
"key": "servicecode",
"value": "AmazonEKS"
},
{
"key": "location",
"value": "Canada (Central)"
},
{
"key": "locationType",
"value": "AWS Region"
},
{
"key": "usagetype",
"value": "CAN1-AmazonEKS-Hours:perCluster"
},
{
"key": "operation",
"value": "CreateOperation"
},
{
"key": "servicename",
"value": "Amazon Elastic Container Service for Kubernetes"
},
{
"key": "tiertype",
"value": "HAStandard"
}
],
"prices": [
{
"USD": "0.1000000000"
}
]
}
]
}
}
Thanks for your help!
infracost
is now in Homebrew (#73) but we don't have a release step for updating the formula. We should add this to our release process.
References:
https://docs.brew.sh/How-To-Open-a-Homebrew-Pull-Request
Docker container actions can only execute on runners with a Linux operating system
There should be either two actions (windows/linux) or a JavaScript executed binary which will allow an action to be run from all support GitHub Runners.
This tool is having problems with the Beta of Terraform0.13 configurations.
INFO Running command: /Users/teranos/go/bin/terraform init
ERROR There are some problems with the configuration, described below.
ERROR
ERROR The Terraform configuration must be valid before initialization so that
ERROR Terraform can determine which modules and providers need to be installed.
ERROR
ERROR Error: Reserved argument name in module block
ERROR
ERROR on ingest.tf line 4, in module "ingest":
ERROR 4: count = var.enable_raven_ingest ? 1 : 0
ERROR
ERROR The name "count" is reserved for use in a future version of Terraform.
ERROR
ERROR
ERROR Error: Reserved argument name in module block
ERROR
ERROR on ingest.tf line 27, in module "ingest":
ERROR 27: depends_on = [
ERROR
ERROR The name "depends_on" is reserved for use in a future version of Terraform.
ERROR
exit status 1
Using an autoscaling module...
module "asg" {
source = "terraform-aws-modules/autoscaling/aws"
version = "~> 3.0"
name = "foobar"
lc_name = "foobar"
image_id = var.ami_id
instance_type = "r5a.xlarge"
security_groups = [aws_security_group.foobar.id]
....
Produces Zero cost.
$ infracost
NAME MONTHLY QTY UNIT PRICE HOURLY COST MONTHLY COST
module.prod-foobar.module.asg.aws_autoscaling_group.this[0]
Total 0.0000 0.0000
OVERALL TOTAL 0.0000 0.0000
Happy to contribute but might need a pointer for where to start looking, I'm new to the tool, but a big fan in principle.... I suspect the tool just might not be recursing down to past the first level module?
For example-
infracost/infracost:1.0.1-tf0.12.26, infracost/infracost:1.0.1-tf0.13.1
When a user wants to implement an open source project, it would be very helpful to know how much the project will cost. This can be done in an automatic way by updating the Readme file of the project.
This can be done via text, or possibly via a https://shields.io/ button (cost!)
One example: https://github.com/gordonmurray/aws_rds_secrets_manager
FYI, I have filed a pending PR for adding this utility into homebrew-core, Homebrew/homebrew-core#60777
Thanks!
I have aws_launch_template
which is using spot instances / spot bidding with autoscaling group, however infracost is showing those instances as on-demand
:
aws_autoscaling_group.spot_asg
ββ Compute (on-demand, t3a.nano) (aws_launch_template.xxx) 730 hours 0.0053 0.0053 3.8690
Add support for on-demand DynamoDB by using usage data support based on infracost's terraform provider.
It would be good to have a mode or option to show the carbon cost of the infrastructure as well as / instead of the monetary cost. This isnβt necessarily proportional to the monetary cost, as different resources (compute, storage, bandwidth) have different carbon weightings, and the different AWS data centre locations have different carbon intensities of their power supplies (some are powered renewably, many arenβt, aiui).
This would give developers some ability to factor in the carbon implications of their infrastructure into decisions, or into calculations of the carbon emissions of their project or business.
Worth considering? π
Currently it shows the current spot price, but only refreshed once per hour.
We might want to allow the user to chose between this, the average over the last 30 days or the maximum spot price.
One option for doing this would be a config file. We also might be able to do it using a custom Terraform provider.
Thanks to @alikhajeh1 our simple scripts are way better than before π . There are still some improvements which we can make:
3_find_attribute_keys.sh
always outputs 2 different products found.
There are cases where combining usage data with actual resources creates conditions that a cost component makes no sense. For instance, a provisioned DynamoDB shall not have read/write request units
.
Here is a simple code for the write request units
cost component:
func NewDynamoDBTable(d *schema.ResourceData, u *schema.ResourceData) *schema.Resource {
costComponents := make([]*schema.CostComponent, 0)
costComponents = append(costComponents, wruCostComponent(d))
}
func wruCostComponent(d *schema.ResourceData) *schema.CostComponent {
costComponent := &schema.CostComponent{}
if billingMode == "PROVISIONED" {
log.Warnf("Skipping write request units usage data for %s. Provisioned mode does not support write request units.", d.Address)
return costComponent
}
...
return costComponent
}
This way, the core produces a warning for the empty cost component and the output shows an empty line.
The other way around is to return nil
and check the result of the function and skip it if it's nil but it makes the code filled with the same conditions.
I propose we add support for nil
cost components in the core.
Pricing page here: https://aws.amazon.com/elasticsearch-service/pricing/
@sashman has offered to help with this too.
See the contributing
branch for WIP
To get costs of an existing infrastructure setup, we need to run something like:
terraform init
infracost --tfdir .
So infracost does a terraform plan internally, and then uses the output of that to generate a report. Alternatively, we can do the terraform plan
manually, and then supply the output to infracost.
Either way is quite slow.
All of the information required to report on existing infrastructure will be in the terraform.tfstate
JSON file for the project, so if it were possible to run something like:
infracost --terraform-statefile=/path/to/my/project/terraform.tfstate
This could enable cost reports to be generated much more quickly - I'd guess a few seconds rather than several minutes, since it shouldn't be necessary to run terraform init
beforehand either.
For many use-cases, this may not be an issue, but in my particular case, with 200+ terraform projects to analyse, it makes a big difference, and I imagine some others will be in a similar situation.
Users who want to make IaC CI/CD easier and want to use Atlantis would find this addition very useful.
https://www.runatlantis.io/
https://github.com/runatlantis/atlantis
infracost --tfdir examples/terraform
It's a nice to have for the above command to also accept the variables required for the terraform plan. For example:
infracost --tfdir examples/terraform -var key=value
or
infracost --tfdir examples/terraform --var-file my.tfvars
Hey @aliscott, I can use infracost with terraform binary without any troubles, but using terragrunt as TERRAFORM_BIRANY fails with the following error:
$ infracost --tfplan /tmp/plan.save --tfdir .
INFO Running command: /Users/hamidreza.josheghani.nl/bin/terragrunt show -json /tmp/plan.save
ERROR [terragrunt] 2020/07/27 18:20:09 Reading Terragrunt config file at /Users/hamidreza.josheghani.nl/.terragrunt-cache/JUfGA5wi4WTKJQMziGewY--KhGo/s2C_bji1SyqpvI6oza4fKa5ohpw/mgmt/jenkins/terragrunt.hcl
ERROR [terragrunt] 2020/07/27 18:20:09 /Users/hamidreza.josheghani.nl/.terragrunt-cache/JUfGA5wi4WTKJQMziGewY--KhGo/s2C_bji1SyqpvI6oza4fKa5ohpw/mgmt/jenkins/terragrunt.hcl:24,10-33: Error in function call; Call to function "find_in_parent_folders" failed: ParentFileNotFound: Could not find a terragrunt.hcl in any of the parent folders of /Users/hamidreza.josheghani.nl/.terragrunt-cache/JUfGA5wi4WTKJQMziGewY--KhGo/s2C_bji1SyqpvI6oza4fKa5ohpw/mgmt/jenkins/terragrunt.hcl. Cause: Traversed all the way to the root.., and 1 other diagnostic(s)
ERROR [terragrunt] 2020/07/27 18:20:09 Unable to determine underlying exit code, so Terragrunt will exit with error code 1
exit status 1
β jenkins git:(65d6dba) β cd ~/Documents/DevOps/bits/in/infrastructure-live/shared-services/us-west-2/mgmt/jenkins
β jenkins git:(master) avshrd infracost --tfplan /tmp/plan.save --tfdir .
INFO Running command: /Users/hamidreza.josheghani.nl/bin/terragrunt show -json /tmp/plan.save
ERROR [terragrunt] 2020/07/27 18:20:18 Reading Terragrunt config file at /Users/hamidreza.josheghani.nl/Documents/DevOps/bits/in/infrastructure-live/shared-services/us-west-2/mgmt/jenkins/terragrunt.hcl
ERROR [terragrunt] [/Users/hamidreza.josheghani.nl/Documents/DevOps/bits/in/infrastructure-live/shared-services/us-west-2/mgmt/jenkins] 2020/07/27 18:20:18 Running command: terraform --version
ERROR [terragrunt] 2020/07/27 18:20:18 Terraform files in /Users/hamidreza.josheghani.nl/.terragrunt-cache/JUfGA5wi4WTKJQMziGewY--KhGo/s2C_bji1SyqpvI6oza4fKa5ohpw/mgmt/jenkins are up to date. Will not download again.
ERROR [terragrunt] 2020/07/27 18:20:18 Copying files from /Users/hamidreza.josheghani.nl/Documents/DevOps/bits/in/infrastructure-live/shared-services/us-west-2/mgmt/jenkins into /Users/hamidreza.josheghani.nl/.terragrunt-cache/JUfGA5wi4WTKJQMziGewY--KhGo/s2C_bji1SyqpvI6oza4fKa5ohpw/mgmt/jenkins
ERROR [terragrunt] 2020/07/27 18:20:18 Setting working directory to /Users/hamidreza.josheghani.nl/.terragrunt-cache/JUfGA5wi4WTKJQMziGewY--KhGo/s2C_bji1SyqpvI6oza4fKa5ohpw/mgmt/jenkins
ERROR [terragrunt] 2020/07/27 18:20:20 Running command: terraform show -json /tmp/plan.save
panic: interface conversion: interface {} is nil, not map[string]interface {}
goroutine 1 [running]:
infracost/pkg/parsers/terraform.parseModule(0x5, 0xc0003e0000, 0x64593, 0x0, 0x0, 0x0, 0x0, 0x5, 0xc00041e5d2, 0xab, ...)
/Users/ali/code/infracost/pkg/parsers/terraform/terraform.go:156 +0x10af
infracost/pkg/parsers/terraform.parseModule(0x5, 0xc0003e0000, 0x64593, 0x0, 0x0, 0x0, 0x0, 0x5, 0xc00041e5d2, 0xab, ...)
/Users/ali/code/infracost/pkg/parsers/terraform/terraform.go:176 +0xd01
infracost/pkg/parsers/terraform.parseModule(0x5, 0xc0003e0000, 0x64593, 0x0, 0x0, 0x0, 0x0, 0x5, 0xc00041e5d2, 0xab, ...)
/Users/ali/code/infracost/pkg/parsers/terraform/terraform.go:176 +0xd01
infracost/pkg/parsers/terraform.ParsePlanJSON(0xc000360000, 0x64593, 0x7fe00, 0xe, 0xc000360000, 0x64593, 0x7fe00, 0x0)
/Users/ali/code/infracost/pkg/parsers/terraform/terraform.go:145 +0x382
main.main.func2(0xc000154a80, 0xc000128e00, 0xe)
/Users/ali/code/infracost/cmd/infracost/main.go:123 +0x256
github.com/urfave/cli/v2.(*App).RunContext(0xc000132180, 0x151d4e0, 0xc000134008, 0xc000138000, 0x5, 0x5, 0x0, 0x0)
/Users/ali/go/pkg/mod/github.com/urfave/cli/[email protected]/app.go:315 +0x70b
github.com/urfave/cli/v2.(*App).Run(...)
/Users/ali/go/pkg/mod/github.com/urfave/cli/[email protected]/app.go:215
main.main()
/Users/ali/code/infracost/cmd/infracost/main.go:153 +0x4fb
Due to the terragrunt being a wrapper around terraform, I expected the same result running infracost with terragrunt binary. I maybe have a wrong assumption, but wanted to ask you about this.
Thanks for this awesome tool :-)
Infracost currently supports ECS with Fargate launch type, but not EC2 launch type.
This should be similar to aws_autoscaling_group
Adding support for AWS aurora RDS cluster in terraform which is defined with aws_rds_cluster
resource type.
e.g. "2 out of 26 resources could not be estimated because they don't have a price or Infracost does not yet support them (https://www.infracost.io/docs/supported_resources)"
Debug level logging could show the resource addresses.
AWS Cloud Formation costs: https://aws.amazon.com/cloudformation/pricing/
aws_cloudformation_stack
and aws_cloudformation_stack_set
are the main resources. For each one, we can use this logic to show the cost components:
template_body
is set AND its "Resources.types" start with AWS::*
, Alexa::*
, or Custom::*
then return IsSkipped: true, NoPrice: true,
as it's a free resource.monthly_handler_operations: 10000 # Monthly number of non-free handler operations (resources outside of the AWS::*, Alexa::*, and Custom::* namespaces).
monthly_duration_secs: 0 # Monthly duration of non-free handler operations that go above 30 seconds, in seconds.
As normal, the cost components should show cost-depends-on-usage if the usage file param is not specified.
Free resources:
aws_cloudformation_stack_set_instance
aws_cloudformation_type
Hello,
I was wondering what would be involved in adding support for ECS (specifically Fargate) pricing - I'm not opposed to implementing this myself but a nudge in the right direction would be great.
Cheers!
DyanamoDB has two pricing options: privisioned and on-demand.
We will support the provisioned mode for starters.
We can modify https://github.com/aliscott/infracost/blob/master/.github/workflows/create-release.yml to push to DockerHub (we have the dockerhub infracost org now)
It seems the unsupported resources are not shown in the report.
I think it's more suitable if the report shows such resources with some "Unknown price" flag. This way users can better track their resources in the report.
Here is a rough idea of this feature:
NAME QUANTITY UNIT PRICE PER UNIT HOURLY COST MONTHLY COST
unknown_resource ? ? ? ? ?
OVERALL TOTAL 0.0000 0.0000
This is a proposal for adding an Infracost Terraform Provider for representing usage based costs. This would allow us to reference any existing Terraform resource and augment it with additional information we can use to calculate the usage costs.
Here is an example of how this could be represented for a lambda function:
resource "infracost_usage_aws_lambda_function" "test_lambda" {
resources = [aws_lambda_function.test_lambda]
estimated_request_count {
min = 10000
max = 15000
}
estimated_request_duration {
min = 260
max = 300
}
}
This would also require a min/max cost range to be represented as first suggested in aliscott#21.
Other options for this could include an additional config file (as suggested in aliscott#34). Other suggestions are welcome.
Is there any way to support instances based on marketplace AMIs? These are typically the most expensive ones so it would be nice to see the "subscription" cost along with the EC2 compute itself.
Not sure how feasible is this with the current approach where you seem to be caching the AWS pricelist separately on your website.
Terraform cloud's cost estimation supports these:
User request to add AWS RDS instances support: https://aws.amazon.com/rds/pricing/
We currently support aws_rds_cluster_instance and aws_rds_cluster. Expand the list to include more (Terraform currently supported RDS below):
@sashman is already working on this, https://github.com/infracost/infracost-orb
Storage prices are dependent on the region (which is available in terraform), the amount of data being stored (which isn't available in terraform) and the storage tier (which is available in terraform)
Can we add a .infracost.config
or something to the repository to mention the rough volume of data in different S3 paths (which should help project costs based on different storage tiers) or is there another way you recommend?
I'm asking because I'd like to take a shot at implementing this. It's my first time in golang so any guidelines I should read up before contributing will be quite helpful.
The aim of this ticket is to update the Infracost JSON output so it includes the following fields, which can then be used in the future to build table/HTML outputs that show the diff of what's about to be applied.
existingState:
resources:
...
totalHourlyCost
totalMonthlyCost
plannedState:
resources:
...
totalHourlyCost
totalMonthlyCost
diff:
resources:
...
totalHourlyCost
totalMonthlyCost
timeGenerated
resourceSummary
Options to support:
So it would be 4*4=16 possible combinations to invoke it.
User can invoke it like
infracost diff --tfdir first/path --tfdir second/path
infracost diff --tfdir first/path --tfplan second/plan
...
So the flag presence order would be important. What other kind of implementations would work better??
A declarative, efficient, and flexible JavaScript library for building user interfaces.
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. πππ
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google β€οΈ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.