I am configuring a GCP Cloud Function via Terraform using:
https://registry.terraform.io/providers/hashicorp/google/latest/docs/resources/cloudfunctions_function
I'll be using source_archive_bucket
and source_archive_object
to have the function built from source code in a zip archive in a GCS bucket.
Reading the https://cloud.google.com/functions/docs/deploy and https://cloud.google.com/functions/docs/building docs it's not clear to me at what point a new version of the function is actually built and deployed.
Does it happen as soon as I push updated zip file to the GCS bucket? i.e. then next execution of the function will use the new image
Or can I first push an updated zip and then do a terraform apply
to get the Cloud Function to pick up the new code?
If I had to guess I'd say the former, but it's not really spelled out explicitly anywhere AFAICT.