hashicorp / terraform-provider-google

Terraform Provider for Google Cloud Platform
https://registry.terraform.io/providers/hashicorp/google/latest/docs
Mozilla Public License 2.0
2.33k stars 1.73k forks source link

Pass build service account for resource cloudfunctions_function #18798

Open davidedironza opened 3 months ago

davidedironza commented 3 months ago

Community Note

Description

Cloud Functions Gen1 already supports to use a custom service account to build the function but it is not implemented in terraform resource yet. In Gen2 resource cloudfunctions2_function it is already implemented https://registry.terraform.io/providers/hashicorp/google/latest/docs/resources/cloudfunctions2_function#service_account. Would be helpful if the custom service account could be passed in both generations

New or Affected Resource(s)

Potential Terraform Configuration

  ...
  build_service_account = "projects/PROJECT_ID/serviceAccounts/custom-service-account@PROJECT_ID.iam..."
  ...

References

https://cloud.google.com/sdk/gcloud/reference/functions/deploy#--build-service-account

b/354725684

BBBmau commented 3 months ago

From triage: Issue is referring to the buildServiceAccount field which is present in the API reference of cloud function gen1: https://cloud.google.com/functions/docs/reference/rest/v1/projects.locations.functions

daanheikens commented 2 months ago

I can pick this one up, looking into this option for one of our gen2 functions. Please assign me.

daanheikens commented 2 months ago

I can pick this one up, looking into this option for one of our gen2 functions. Please assign me.

Apologies, I see I misunderstood the request. It's for gen1. Anyway, I can still do this, no problem 👍