diff --git a/build/int.cloudbuild.yaml b/build/int.cloudbuild.yaml index abbe42d..5aeb366 100644 --- a/build/int.cloudbuild.yaml +++ b/build/int.cloudbuild.yaml @@ -26,7 +26,7 @@ steps: args: ['/bin/bash', '-c', 'source /usr/local/bin/task_helper_functions.sh && source_test_env && init_credentials && cd test/integration && RUN_STAGE=init go test -v ./... -p 1'] - id: converge name: 'gcr.io/cloud-foundation-cicd/$_DOCKER_IMAGE_DEVELOPER_TOOLS:$_DOCKER_TAG_VERSION_DEVELOPER_TOOLS' - args: ['/bin/bash', '-c', 'source /usr/local/bin/task_helper_functions.sh && source_test_env && init_credentials && cd test/integration && RUN_STAGE=apply go test -v ./... -p 1'] + args: ['/bin/bash', '-c', 'source /usr/local/bin/task_helper_functions.sh && source_test_env && init_credentials && cd test/integration && RUN_STAGE=apply go test -v ./... -timeout 0 -p 1'] - id: verify name: 'gcr.io/cloud-foundation-cicd/$_DOCKER_IMAGE_DEVELOPER_TOOLS:$_DOCKER_TAG_VERSION_DEVELOPER_TOOLS' args: ['/bin/bash', '-c', 'source /usr/local/bin/task_helper_functions.sh && source_test_env && init_credentials && cd test/integration && RUN_STAGE=verify go test -v ./... -p 1'] diff --git a/modules/repository-function/README.md b/modules/repository-function/README.md index 5108e99..4940929 100644 --- a/modules/repository-function/README.md +++ b/modules/repository-function/README.md @@ -29,6 +29,7 @@ is a tested reference of how to use this submodule with the | project\_id | The ID of the project to which resources will be applied. | `string` | n/a | yes | | region | The region in which resources will be applied. | `string` | n/a | yes | | runtime | The runtime in which the function will be executed. | `string` | `"nodejs6"` | no | +| service\_account\_email | The service account to run the function as. | `string` | `""` | no | | source\_repository\_url | The URL of the repository which contains the function source code. | `string` | n/a | yes | | timeout\_s | The amount of time in seconds allotted for the execution of the function. | `number` | `60` | no | | vpc\_connector | The VPC Network Connector that this cloud function can connect to. It should be set up as fully-qualified URI. The format of this field is projects/\*/locations/\*/connectors/\*. | `string` | `null` | no | diff --git a/modules/repository-function/main.tf b/modules/repository-function/main.tf index bb03afb..b5e67b5 100644 --- a/modules/repository-function/main.tf +++ b/modules/repository-function/main.tf @@ -37,6 +37,7 @@ resource "google_cloudfunctions_function" "main" { url = var.source_repository_url } - project = var.project_id - region = var.region + project = var.project_id + region = var.region + service_account_email = var.service_account_email } diff --git a/modules/repository-function/variables.tf b/modules/repository-function/variables.tf index 7406899..4faaac2 100644 --- a/modules/repository-function/variables.tf +++ b/modules/repository-function/variables.tf @@ -80,6 +80,12 @@ variable "timeout_s" { description = "The amount of time in seconds allotted for the execution of the function." } +variable "service_account_email" { + type = string + default = "" + description = "The service account to run the function as." +} + variable "ingress_settings" { type = string default = "ALLOW_ALL"