Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

handle cloudfunctions deprecating nodejs6 #2499

Merged
merged 3 commits into from
Oct 22, 2019
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion templates/inspec/tests/integration/build/gcp-mm.tf
Original file line number Diff line number Diff line change
Expand Up @@ -591,7 +591,7 @@ resource "google_cloudfunctions_function" "function" {
trigger_http = "${var.cloudfunction["trigger_http"]}"
timeout = "${var.cloudfunction["timeout"]}"
entry_point = "${var.cloudfunction["entry_point"]}"
runtime = "nodejs6"
runtime = "nodejs8"

environment_variables = {
MY_ENV_VAR = "${var.cloudfunction["env_var_value"]}"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -189,9 +189,9 @@ func resourceCloudFunctionsFunction() *schema.Resource {
},

"runtime": {
Type: schema.TypeString,
Optional: true,
Default: "nodejs6",
Type: schema.TypeString,
Required: true,
ValidateFunc: validation.StringInSlice([]string{"nodejs8", "nodejs10", "python37", "go111"}, false),
},

"service_account_email": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -524,6 +524,7 @@ resource "google_storage_bucket_object" "archive" {

resource "google_cloudfunctions_function" "function" {
name = "%s"
runtime = "nodejs8"
description = "test function"
available_memory_mb = 128
source_archive_bucket = "${google_storage_bucket.bucket.name}"
Expand Down Expand Up @@ -628,7 +629,7 @@ resource "google_storage_bucket_object" "archive" {

resource "google_cloudfunctions_function" "function" {
name = "%s"
runtime = "nodejs6"
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 @@ -659,6 +660,7 @@ resource "google_storage_bucket_object" "archive" {

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 @@ -686,6 +688,7 @@ resource "google_storage_bucket_object" "archive" {

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 All @@ -702,6 +705,7 @@ func testAccCloudFunctionsFunction_sourceRepo(functionName, project string) stri
return fmt.Sprintf(`
resource "google_cloudfunctions_function" "function" {
name = "%s"
runtime = "nodejs8"

source_repository {
// There isn't yet an API that'll allow us to create a source repository and
Expand Down Expand Up @@ -733,6 +737,7 @@ data "google_compute_default_service_account" "default" { }

resource "google_cloudfunctions_function" "function" {
name = "%s"
runtime = "nodejs8"

source_archive_bucket = "${google_storage_bucket.bucket.name}"
source_archive_object = "${google_storage_bucket_object.archive.name}"
Expand Down Expand Up @@ -778,6 +783,7 @@ resource "google_storage_bucket_object" "archive" {

resource "google_cloudfunctions_function" "function" {
name = "%s"
runtime = "nodejs8"
provider = "google-beta"

description = "test function"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,10 +105,8 @@ 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.
* `runtime` - (Required) The runtime in which the function is going to run. One
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
* `runtime` - (Required) The runtime in which the function is going to run. One
* `runtime` - (Required) The runtime in which the function is going to run. Eg.

(also dropping the "of" on the line below- don't apply this directly)

While we probably don't want to validate the list of languages since we expect it to change moderately frequently, providing a list of sample values will help users enter the right thing.

of `"nodejs8"`, `"nodejs10"`, `"python37"`, `"go111"`.

- - -

Expand Down