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 all 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,8 @@ func resourceCloudFunctionsFunction() *schema.Resource {
},

"runtime": {
Type: schema.TypeString,
Optional: true,
Default: "nodejs6",
Type: schema.TypeString,
Required: true,
},

"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.
Eg. `"nodejs8"`, `"nodejs10"`, `"python37"`, `"go111"`.

- - -

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ so Terraform knows to manage them.

- [Provider Version Configuration](#provider-version-configuration)
- [Data Source: `google_container_engine_versions`](#data-source-google_container_engine_versions)
- [Resource: `google_cloudfunctions_function`](#resource-google_cloudfunctions_function)
- [Resource: `google_cloudiot_registry`](#resource-google_cloudiot_registry)
- [Resource: `google_compute_forwarding_rule`](#resource-google_compute_forwarding_rule)
- [Resource: `google_compute_network`](#resource-google_compute_network)
Expand Down Expand Up @@ -109,6 +110,13 @@ provider "google" {

Use `location` instead.

## Resource: `google_cloudfunctions_function`

### The `runtime` option `nodejs6` has been deprecated

`nodejs6` has been deprecated and is no longer the default value for `runtime`.
`runtime` is now required.

## Resource: `google_cloudiot_registry`

### `event_notification_config` is now removed
Expand Down