From f2ec6edf81716f8ce474652e70539bf86f7ba02d Mon Sep 17 00:00:00 2001 From: Jan Martens <44572196+JanMa@users.noreply.github.com> Date: Fri, 25 Oct 2019 15:11:18 +0200 Subject: [PATCH] Revert "Fix formatting on Cloud Functions docs (#2469)" This reverts commit 3e2011b7ceb1cd4534209178548ee813e693dceb. --- build/terraform | 2 +- build/terraform-beta | 2 +- .../r/cloudfunctions_function.html.markdown | 32 ++++++++++--------- 3 files changed, 19 insertions(+), 17 deletions(-) diff --git a/build/terraform b/build/terraform index a0dfdc80c5df..1db04e9e73ac 160000 --- a/build/terraform +++ b/build/terraform @@ -1 +1 @@ -Subproject commit a0dfdc80c5df22af808f004180695f9e4d578356 +Subproject commit 1db04e9e73acb6bc91ab24ea2e48dd95cd88aa1a diff --git a/build/terraform-beta b/build/terraform-beta index c39a624b52e6..b4b3a5a2ccd2 160000 --- a/build/terraform-beta +++ b/build/terraform-beta @@ -1 +1 @@ -Subproject commit c39a624b52e61bf4ff6920e1973fc6f558c275cb +Subproject commit b4b3a5a2ccd24537f1cd89e07855395b55150c97 diff --git a/third_party/terraform/website/docs/r/cloudfunctions_function.html.markdown b/third_party/terraform/website/docs/r/cloudfunctions_function.html.markdown index 4a87b69f6b98..ccd9cdb9e323 100644 --- a/third_party/terraform/website/docs/r/cloudfunctions_function.html.markdown +++ b/third_party/terraform/website/docs/r/cloudfunctions_function.html.markdown @@ -19,7 +19,9 @@ to be invoked. See below examples for how to set up the appropriate permissions, or view the [Cloud Functions IAM resources](/docs/providers/google/r/cloudfunctions_cloud_function_iam.html) for Cloud Functions. -## Example Usage - Public Function +## Example Usage + +Secured function with a user allowed to invoke: ```hcl resource "google_storage_bucket" "bucket" { @@ -41,21 +43,30 @@ resource "google_cloudfunctions_function" "function" { source_archive_bucket = "${google_storage_bucket.bucket.name}" source_archive_object = "${google_storage_bucket_object.archive.name}" trigger_http = true + timeout = 60 entry_point = "helloGET" + labels = { + my-label = "my-label-value" + } + + environment_variables = { + MY_ENV_VAR = "my-env-var-value" + } } -# IAM entry for all users to invoke the function +# Add IAM member for a user who can invoke the function (no admin actions) resource "google_cloudfunctions_function_iam_member" "invoker" { project = "${google_cloudfunctions_function.function.project}" region = "${google_cloudfunctions_function.function.region}" cloud_function = "${google_cloudfunctions_function.function.name}" role = "roles/cloudfunctions.invoker" - member = "allUsers" + member = "user:myFunctionInvoker@example.com" } ``` -## Example Usage - Single User +A publically invocable function (similar behavior to functions created before +private-by-default): ```hcl resource "google_storage_bucket" "bucket" { @@ -77,28 +88,19 @@ resource "google_cloudfunctions_function" "function" { source_archive_bucket = "${google_storage_bucket.bucket.name}" source_archive_object = "${google_storage_bucket_object.archive.name}" trigger_http = true - timeout = 60 entry_point = "helloGET" - labels = { - my-label = "my-label-value" - } - - environment_variables = { - MY_ENV_VAR = "my-env-var-value" - } } -# IAM entry for a single user to invoke the function +# Add IAM member for a user who can invoke the function (no admin actions) resource "google_cloudfunctions_function_iam_member" "invoker" { project = "${google_cloudfunctions_function.function.project}" region = "${google_cloudfunctions_function.function.region}" cloud_function = "${google_cloudfunctions_function.function.name}" role = "roles/cloudfunctions.invoker" - member = "user:myFunctionInvoker@example.com" + member = "allUsers" } ``` - ## Argument Reference The following arguments are supported: