From 1ba048535ed5aebdfbd141d3b566f644a593977f Mon Sep 17 00:00:00 2001 From: The Magician Date: Thu, 9 May 2019 15:50:26 -0700 Subject: [PATCH] Add a default to Cloud Functions runtime (#3605) Signed-off-by: Modular Magician --- google/resource_cloudfunctions_function.go | 2 +- google/resource_cloudfunctions_function_test.go | 2 ++ website/docs/r/cloudfunctions_function.html.markdown | 9 +++++++-- 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/google/resource_cloudfunctions_function.go b/google/resource_cloudfunctions_function.go index e498f9d6..198df1e4 100644 --- a/google/resource_cloudfunctions_function.go +++ b/google/resource_cloudfunctions_function.go @@ -185,7 +185,7 @@ func resourceCloudFunctionsFunction() *schema.Resource { "runtime": { Type: schema.TypeString, Optional: true, - Computed: true, + Default: "nodejs6", }, "service_account_email": { diff --git a/google/resource_cloudfunctions_function_test.go b/google/resource_cloudfunctions_function_test.go index 7fc64047..75d9d24e 100644 --- a/google/resource_cloudfunctions_function_test.go +++ b/google/resource_cloudfunctions_function_test.go @@ -560,6 +560,7 @@ resource "google_pubsub_topic" "sub" { resource "google_cloudfunctions_function" "function" { name = "%s" + runtime = "nodejs8" available_memory_mb = 128 source_archive_bucket = "${google_storage_bucket.bucket.name}" source_archive_object = "${google_storage_bucket_object.archive.name}" @@ -590,6 +591,7 @@ resource "google_storage_bucket_object" "archive" { resource "google_cloudfunctions_function" "function" { name = "%s" + runtime = "nodejs6" available_memory_mb = 128 source_archive_bucket = "${google_storage_bucket.bucket.name}" source_archive_object = "${google_storage_bucket_object.archive.name}" diff --git a/website/docs/r/cloudfunctions_function.html.markdown b/website/docs/r/cloudfunctions_function.html.markdown index 98383e1c..c7ce5aa7 100644 --- a/website/docs/r/cloudfunctions_function.html.markdown +++ b/website/docs/r/cloudfunctions_function.html.markdown @@ -29,6 +29,8 @@ resource "google_storage_bucket_object" "archive" { resource "google_cloudfunctions_function" "function" { name = "function-test" description = "My function" + runtime = "nodejs10" + available_memory_mb = 128 source_archive_bucket = "${google_storage_bucket.bucket.name}" source_archive_object = "${google_storage_bucket_object.archive.name}" @@ -51,6 +53,11 @@ The following arguments are supported: * `name` - (Required) A user-defined name of the function. Function names must be unique globally. +* `runtime` - (Optional) The runtime in which the function is going to run. One +of `"nodejs6"`, `"nodejs8"`, `"nodejs10"`, `"python37"`, `"go111"`. If empty, +defaults to `"nodejs6"`. It's recommended that you override the default, as +`"nodejs6"` is deprecated. + - - - * `description` - (Optional) Description of the function. @@ -67,8 +74,6 @@ The following arguments are supported: * `labels` - (Optional) A set of key/value label pairs to assign to the function. -* `runtime` - (Optional) The runtime in which the function is going to run. If empty, defaults to `"nodejs6"`. - * `service_account_email` - (Optional) If provided, the self-provided service account to run the function with. * `environment_variables` - (Optional) A set of key/value environment variable pairs to assign to the function.