Skip to content

Commit

Permalink
Add a default to Cloud Functions runtime (#697)
Browse files Browse the repository at this point in the history
Signed-off-by: Modular Magician <magic-modules@google.com>
  • Loading branch information
modular-magician authored and rileykarson committed May 9, 2019
1 parent 0978853 commit d2a92d8
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
2 changes: 1 addition & 1 deletion google-beta/resource_cloudfunctions_function.go
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ func resourceCloudFunctionsFunction() *schema.Resource {
"runtime": {
Type: schema.TypeString,
Optional: true,
Computed: true,
Default: "nodejs6",
},

"service_account_email": {
Expand Down
2 changes: 2 additions & 0 deletions google-beta/resource_cloudfunctions_function_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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}"
Expand Down Expand Up @@ -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}"
Expand Down
9 changes: 7 additions & 2 deletions website/docs/r/cloudfunctions_function.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -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}"
Expand All @@ -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.
Expand All @@ -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.
Expand Down

0 comments on commit d2a92d8

Please sign in to comment.