You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
template.metadata.annotations["run.googleapis.com/cpu-throttling"] (this is true by default)
And add the following usage attributes:
monthly_requests
These are used if CPU throttling is enabled:
average_request_duration
concurrent_requests_per_instance
These are only used if CPU throttling is disabled.
instance_hrs
The cost components will then be calculated as:
CPU allocation:
If CPU throttling is disabled
if instance_hrs is specified use that, otherwise use the min scale value * 730 for the instance hours.
Multiply the instance hours by the sum of the CPU values to find the CPU usage.
If CPU throttling is enabled:
The instance hours should be calculated from (monthly requests * average request_duration) / concurrent requests per instance. This should then be multiplied by the sum of the CPU values.
Memory allocation:
Use the same calculation as CPU. This should follow the same logic depending on if CPU throttling is disabled or not.
Requests:
Based on the monthly_requests usage value
The prices for all the cost components are also based on whether the region of the resource is a Tier 1 or Tier 2 region. We might need to define a static mapping for these initially.
google_cloud_run_v2_service
This uses the same logic as the google_cloud_run_service resource but the attributes are slightly different:
template.containers[*].resources.limits.cpu
template.containers[*].resources.limits.memory
template.scaling.min_instance_count
template.containers[*].resources.limits.cpu_idle
google_cloud_run_v2_job
We will need to extract the following attributes from the Terraform:
I would like to contribute to this issue, It would be nice to get resource implementation details on this and also cost components names, units, and some pricing details.
@awaismemon26 Hello! Thank you! Please give us some time to figure out the details that the resource needs and we'll update the issue. I saw you requested access to the Cloud Pricing API in community Slack. we'll ping you there with the instructions too. I'll assign you to the issue just now. Thanks again!
Google pricing: https://cloud.google.com/run/pricing
Terraform resources:
Details
google_cloud_run_service
We will need to extract the following attributes from the Terraform:
template.spec.containers[*].resources.limits.cpu
template.spec.containers[*].resources.limits.memory
template.metadata.annotations["autoscaling.knative.dev/minScale"]
template.metadata.annotations["run.googleapis.com/cpu-throttling"]
(this is true by default)And add the following usage attributes:
monthly_requests
average_request_duration
concurrent_requests_per_instance
instance_hrs
The cost components will then be calculated as:
instance_hrs
is specified use that, otherwise use the min scale value * 730 for the instance hours.monthly_requests
usage valueThe prices for all the cost components are also based on whether the region of the resource is a Tier 1 or Tier 2 region. We might need to define a static mapping for these initially.
google_cloud_run_v2_service
This uses the same logic as the
google_cloud_run_service
resource but the attributes are slightly different:template.containers[*].resources.limits.cpu
template.containers[*].resources.limits.memory
template.scaling.min_instance_count
template.containers[*].resources.limits.cpu_idle
google_cloud_run_v2_job
We will need to extract the following attributes from the Terraform:
template.template.containers[*].resources.limits.cpu
template.template.containers[*].resources.limits.memory
template.task_count
Pricing again depends on if the region is a tier 1 or tier 2 region.
And add the following usage attributes:
monthly_job_executions
average_task_execution_mins
The cost components will then be calculated as:
These resources can be added as free resources:
google_cloud_run_service_iam_policy
google_cloud_run_service_iam_binding
google_cloud_run_service_iam_member
google_cloud_run_domain_mapping
google_cloud_run_v2_job_iam
google_cloud_run_v2_service_iam
The text was updated successfully, but these errors were encountered: