diff --git a/third_party/terraform/resources/resource_cloudfunctions_function.go b/third_party/terraform/resources/resource_cloudfunctions_function.go index 5c1b6192efb6..6ac46a67dd4c 100644 --- a/third_party/terraform/resources/resource_cloudfunctions_function.go +++ b/third_party/terraform/resources/resource_cloudfunctions_function.go @@ -586,6 +586,10 @@ func resourceCloudFunctionsUpdate(d *schema.ResourceData, meta interface{}) erro return handleNotFoundError(err, d, fmt.Sprintf("Target CloudFunctions Function %q", cloudFuncId.Name)) } + // The full function may contain a reference to manually uploaded code if the function was imported from gcloud + // This does not work with Terraform, so zero it out from the function if it exists. See https://github.com/hashicorp/terraform-provider-google/issues/7921 + function.SourceUploadUrl = "" + d.Partial(true) var updateMaskArr []string