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

Resources billed per hour should use hours as unit #104

Open
Seraf opened this issue Jun 13, 2023 · 0 comments
Open

Resources billed per hour should use hours as unit #104

Seraf opened this issue Jun 13, 2023 · 0 comments
Labels
bug Something isn't working

Comments

@Seraf
Copy link
Member

Seraf commented Jun 13, 2023

On the JSON generated by Terracost, some resources like aws_instance are not correctly computed.
The cost result is correct, but there's a miss on quantity and unit attributes:

{
   "planned_cost":"121.336",
   "planned_hourly_cost":"0.166214",
   "prior_cost":"0",
   "prior_hourly_cost":"0",
   "resource_estimates":[
      {
         "address":"module.nexus.aws_instance.nexus",
         "components":[
            {
               "label":"Compute",
               "planned":{
                  "cost":"119.136",
                  "details":[
                     "Linux",
                     "on-demand",
                     "t3a.xlarge"
                  ],
                  "hourly_cost":"0.1632",
                  "quantity":1
               },
               "rate":"119.136"
            },
            {
               "label":"Root volume: Storage",
               "planned":{
                  "cost":"2.2",
                  "details":[
                     "gp2"
                  ],
                  "hourly_cost":"0.003014",
                  "quantity":20
               },
               "rate":"0.11",
               "unit":"GB"
            }
         ],
         "planned_cost":"121.336",
         "planned_hourly_cost":"0.166214",
         "prior_cost":"0",
         "prior_hourly_cost":"0",
         "provider":"aws",
         "type":"aws_instance"
      }
   ],
}

On this example, the rate, quantity and unit should be calculated in terms of hours, using 730 as quantity instead of considering 1 instance as a quantity. Users are not buying an instance, but an amount of hour of an instance.

@Seraf Seraf added the bug Something isn't working label Jun 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant