Skip to content

Commit

Permalink
handle cloudfunctions deprecating nodejs6 (#2499)
Browse files Browse the repository at this point in the history
  • Loading branch information
megan07 authored and rileykarson committed Nov 11, 2019
1 parent c5cd121 commit 83f78a1
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 9 deletions.
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 @@ -612,7 +612,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 @@ -187,9 +187,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 @@ -54,6 +54,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_container_cluster`](#resource-google_container_cluster)
- [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 @@ -308,6 +309,13 @@ introducing an incompatibility for users who specify config in JSON instead of
HCL or who use `dynamic` blocks. See more details in the [Attributes as Blocks](https://www.terraform.io/docs/configuration/attr-as-blocks.html)
documentation.

## 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
Original file line number Diff line number Diff line change
Expand Up @@ -106,10 +106,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

0 comments on commit 83f78a1

Please sign in to comment.