Closed patrislav closed 3 years ago
Or it could also be nice to have a more detailed view returned:
CostEstimation: {
estimated: +1000.00,
processed: [
"EC2": +900.00,
"RDS": +100.00,
"S3": -100.00
],
free: ["SecurityGroup"],
unsupported: ["ASG", "Athena"]
}
?
You're suggesting grouping the skipped resources by service and displaying the service names instead of resources? Yes, we could tag each resource with a service name to which they belong, but there might be some problems:
aws_instance
and aws_ebs_volume
), and some of them are free, so the EC2 service could be both "processed", "unsupported" and "free" at the same time.So, while we can have a list of processed services with a break down of their costs, I'm not sure whether it'd work with "free" and "unsupported".
No no, it's just while I was writing those are the first things that came to mind, but you're right, it makes more sense with resources rather than services :+1:
Abstract
Currently, only the resources that had been successfully estimated are returned. The user has no way of knowing which resources from the plan were skipped (due to e.g. not being supported).
The skipped resources should be returned alongside the estimated ones.
Implementation details
This could be accomplished by including a
SkippedResources []string
field (or similar) in thecost.State
struct, as well as having a helper method on thecost.Plan
to extract them.Suggestions/ideas
Many Terraform resources are inherently free (such as from the
null
orlocal
providers) and shouldn't be included as "skipped." One idea could be to have a list of free resources that should never be estimated and that should never be marked as "skipped." The other would be to ignore all unknown providers and mark as skipped only unsupported resources of supported providers.