GoogleCloudPlatform / terraform-google-cloud-functions

Deploys Cloud Functions (Gen 2)
https://registry.terraform.io/modules/GoogleCloudPlatform/cloud-functions/google
Apache License 2.0
30 stars 25 forks source link

Add available_cpu to service_config in functions #63

Closed andrewwljackson closed 11 months ago

andrewwljackson commented 11 months ago

Hi there, I was hoping to include CPU in the functions config as one needs at least 1 CPU to up the concurrent requests. I made a pr but cannot push because of access issues. It should be an easy win:

in main.tf:80

dynamic "service_config" {
    for_each = var.service_config != null ? [var.service_config] : []
    content {
      max_instance_count    = service_config.value.max_instance_count
      min_instance_count    = service_config.value.min_instance_count
      available_memory      = service_config.value.available_memory
      available_cpu         = service_config.value.available_cpu  #### addition

and variables.tf:113:

variable "service_config" {
  description = "Details of the service"
  type = object({
    max_instance_count    = optional(string, 100)
    min_instance_count    = optional(string, 1)
    available_memory      = optional(string, "256M")
    available_cpu         = optional(string, "1") #### addition
gtsorbo commented 11 months ago

Hi @andrewwljackson! Thanks for your contribution. To create a PR you'll need to fork the repo and then create the PR from your fork, instead of branching the repo directly. Also, if you are not currently covered under a CLA, please visit https://cla.developers.google.com/ to sign before submitting the PR. Once you do that we can take a look.

andrewwljackson commented 11 months ago

Hey @gtsorbo thanks so much for the response. I have signed the CLA, forked the repo and pushed a PR for your review, when you have time 👍