Skip to content

Commit 1ba0485

Browse files
modular-magicianrileykarson
authored andcommitted
Add a default to Cloud Functions runtime (#3605)
Signed-off-by: Modular Magician <[email protected]>
1 parent 3e40eb5 commit 1ba0485

File tree

3 files changed

+10
-3
lines changed

3 files changed

+10
-3
lines changed

google/resource_cloudfunctions_function.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ func resourceCloudFunctionsFunction() *schema.Resource {
185185
"runtime": {
186186
Type: schema.TypeString,
187187
Optional: true,
188-
Computed: true,
188+
Default: "nodejs6",
189189
},
190190

191191
"service_account_email": {

google/resource_cloudfunctions_function_test.go

+2
Original file line numberDiff line numberDiff line change
@@ -560,6 +560,7 @@ resource "google_pubsub_topic" "sub" {
560560
561561
resource "google_cloudfunctions_function" "function" {
562562
name = "%s"
563+
runtime = "nodejs8"
563564
available_memory_mb = 128
564565
source_archive_bucket = "${google_storage_bucket.bucket.name}"
565566
source_archive_object = "${google_storage_bucket_object.archive.name}"
@@ -590,6 +591,7 @@ resource "google_storage_bucket_object" "archive" {
590591
591592
resource "google_cloudfunctions_function" "function" {
592593
name = "%s"
594+
runtime = "nodejs6"
593595
available_memory_mb = 128
594596
source_archive_bucket = "${google_storage_bucket.bucket.name}"
595597
source_archive_object = "${google_storage_bucket_object.archive.name}"

website/docs/r/cloudfunctions_function.html.markdown

+7-2
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@ resource "google_storage_bucket_object" "archive" {
2929
resource "google_cloudfunctions_function" "function" {
3030
name = "function-test"
3131
description = "My function"
32+
runtime = "nodejs10"
33+
3234
available_memory_mb = 128
3335
source_archive_bucket = "${google_storage_bucket.bucket.name}"
3436
source_archive_object = "${google_storage_bucket_object.archive.name}"
@@ -51,6 +53,11 @@ The following arguments are supported:
5153

5254
* `name` - (Required) A user-defined name of the function. Function names must be unique globally.
5355

56+
* `runtime` - (Optional) The runtime in which the function is going to run. One
57+
of `"nodejs6"`, `"nodejs8"`, `"nodejs10"`, `"python37"`, `"go111"`. If empty,
58+
defaults to `"nodejs6"`. It's recommended that you override the default, as
59+
`"nodejs6"` is deprecated.
60+
5461
- - -
5562

5663
* `description` - (Optional) Description of the function.
@@ -67,8 +74,6 @@ The following arguments are supported:
6774

6875
* `labels` - (Optional) A set of key/value label pairs to assign to the function.
6976

70-
* `runtime` - (Optional) The runtime in which the function is going to run. If empty, defaults to `"nodejs6"`.
71-
7277
* `service_account_email` - (Optional) If provided, the self-provided service account to run the function with.
7378

7479
* `environment_variables` - (Optional) A set of key/value environment variable pairs to assign to the function.

0 commit comments

Comments
 (0)