Add a default to Cloud Functions runtime (#3605)

Signed-off-by: Modular Magician <magic-modules@google.com>
This commit is contained in:
The Magician 2019-05-09 15:50:26 -07:00 committed by Riley Karson
parent 3e40eb5014
commit 1ba048535e
3 changed files with 10 additions and 3 deletions

View File

@ -185,7 +185,7 @@ func resourceCloudFunctionsFunction() *schema.Resource {
"runtime": {
Type: schema.TypeString,
Optional: true,
Computed: true,
Default: "nodejs6",
},
"service_account_email": {

View File

@ -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}"

View File

@ -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.