Skip to content

Commit f2b3a98

Browse files
NicholasAzarNicholas Azarbharathkkb
authored
feat: add service_account_email to repository_function input (#78)
* feat: add service_account_email to repository_function input * set timeout to cloudbuild default Co-authored-by: Nicholas Azar <nzar@google.com> Co-authored-by: Bharath KKB <bharathkrishnakb@gmail.com>
1 parent e917a27 commit f2b3a98

File tree

4 files changed

+11
-3
lines changed

4 files changed

+11
-3
lines changed

build/int.cloudbuild.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ steps:
2626
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']
2727
- id: converge
2828
name: 'gcr.io/cloud-foundation-cicd/$_DOCKER_IMAGE_DEVELOPER_TOOLS:$_DOCKER_TAG_VERSION_DEVELOPER_TOOLS'
29-
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']
29+
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']
3030
- id: verify
3131
name: 'gcr.io/cloud-foundation-cicd/$_DOCKER_IMAGE_DEVELOPER_TOOLS:$_DOCKER_TAG_VERSION_DEVELOPER_TOOLS'
3232
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']

modules/repository-function/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ is a tested reference of how to use this submodule with the
2929
| project\_id | The ID of the project to which resources will be applied. | `string` | n/a | yes |
3030
| region | The region in which resources will be applied. | `string` | n/a | yes |
3131
| runtime | The runtime in which the function will be executed. | `string` | `"nodejs6"` | no |
32+
| service\_account\_email | The service account to run the function as. | `string` | `""` | no |
3233
| source\_repository\_url | The URL of the repository which contains the function source code. | `string` | n/a | yes |
3334
| timeout\_s | The amount of time in seconds allotted for the execution of the function. | `number` | `60` | no |
3435
| 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 |

modules/repository-function/main.tf

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ resource "google_cloudfunctions_function" "main" {
3737
url = var.source_repository_url
3838
}
3939

40-
project = var.project_id
41-
region = var.region
40+
project = var.project_id
41+
region = var.region
42+
service_account_email = var.service_account_email
4243
}

modules/repository-function/variables.tf

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,12 @@ variable "timeout_s" {
8080
description = "The amount of time in seconds allotted for the execution of the function."
8181
}
8282

83+
variable "service_account_email" {
84+
type = string
85+
default = ""
86+
description = "The service account to run the function as."
87+
}
88+
8389
variable "ingress_settings" {
8490
type = string
8591
default = "ALLOW_ALL"

0 commit comments

Comments
 (0)