File tree Expand file tree Collapse file tree 5 files changed +33
-33
lines changed Expand file tree Collapse file tree 5 files changed +33
-33
lines changed Original file line number Diff line number Diff line change @@ -82,8 +82,8 @@ module "cronjob-gen2" {
82
82
target_function_name = module. cloud_function_gen2 [each . value . name ]. function_name
83
83
https_trigger_url = module. cloud_function_gen2 [each . value . name ]. function_trigger_url
84
84
# passing the static values
85
- target_project = var. project
86
- target_region = var. region
85
+ target_project = var. project
86
+ target_region = var. region
87
87
deploy_sa_email = var. deploy_sa_email
88
88
89
89
depends_on = [
Original file line number Diff line number Diff line change 1
1
# Project-wide roles
2
2
locals {
3
- roles = [
4
- " roles/viewer" , # general read-only access to most Google Cloud resources
5
- " roles/storage.admin" , # full access to manage GCS buckets and objects
6
- " roles/secretmanager.secretAccessor" , # access to Secret Manager
7
- " roles/cloudfunctions.developer" , # deploy and manage Cloud Functions
8
- " roles/logging.viewer" , # view logs
9
- " roles/iam.serviceAccountUser" , # necessary to invoke Cloud Functions
10
- " roles/iam.workloadIdentityPoolViewer" # view workload identity pool
11
- ]
3
+ roles = [
4
+ " roles/viewer" , # general read-only access to most Google Cloud resources
5
+ " roles/storage.admin" , # full access to manage GCS buckets and objects
6
+ " roles/secretmanager.secretAccessor" , # access to Secret Manager
7
+ " roles/cloudfunctions.developer" , # deploy and manage Cloud Functions
8
+ " roles/logging.viewer" , # view logs
9
+ " roles/iam.serviceAccountUser" , # necessary to invoke Cloud Functions
10
+ " roles/iam.workloadIdentityPoolViewer" # view workload identity pool
11
+ ]
12
12
}
13
13
14
14
resource "google_project_iam_member" "project_roles" {
15
15
for_each = toset (local. roles )
16
- project = var. project
17
- role = each. value
18
- member = " serviceAccount:${ google_service_account . gha_cloud_functions_deployment . email } "
16
+ project = var. project
17
+ role = each. value
18
+ member = " serviceAccount:${ google_service_account . gha_cloud_functions_deployment . email } "
19
19
20
20
}
Original file line number Diff line number Diff line change @@ -28,9 +28,9 @@ provider "google" {
28
28
}
29
29
30
30
resource "google_storage_bucket" "staging_bucket" {
31
- name = " ${ local . project } -cloud-function-staging"
32
- location = " US"
33
- force_destroy = true
31
+ name = " ${ local . project } -cloud-function-staging"
32
+ location = " US"
33
+ force_destroy = true
34
34
public_access_prevention = " enforced"
35
35
}
36
36
@@ -40,8 +40,8 @@ resource "google_storage_bucket_iam_binding" "staging-bucket-iam" {
40
40
41
41
members = [" serviceAccount:${ module . infrastructure . deploy_sa_email } " ]
42
42
43
- depends_on = [
44
- module . infrastructure ,
43
+ depends_on = [
44
+ module . infrastructure ,
45
45
google_storage_bucket . staging_bucket
46
46
]
47
47
}
@@ -53,10 +53,10 @@ resource "google_storage_bucket_iam_member" "staging_bucket_get" {
53
53
}
54
54
55
55
resource "google_storage_bucket" "tf-state" {
56
- name = " ${ local . project } -tfstate"
57
- force_destroy = false
58
- location = " US"
59
- storage_class = " STANDARD"
56
+ name = " ${ local . project } -tfstate"
57
+ force_destroy = false
58
+ location = " US"
59
+ storage_class = " STANDARD"
60
60
public_access_prevention = " enforced"
61
61
versioning {
62
62
enabled = true
@@ -69,8 +69,8 @@ resource "google_storage_bucket_iam_binding" "tfstate-bucket-iam" {
69
69
70
70
members = [" serviceAccount:${ module . infrastructure . deploy_sa_email } " ]
71
71
72
- depends_on = [
73
- module . infrastructure ,
72
+ depends_on = [
73
+ module . infrastructure ,
74
74
google_storage_bucket . tf-state
75
75
]
76
76
}
Original file line number Diff line number Diff line change @@ -31,7 +31,7 @@ variable "runtime" {
31
31
type = string
32
32
description = " Function runtime, default python 3.11"
33
33
default = " python311"
34
- nullable = false
34
+ nullable = false
35
35
}
36
36
37
37
variable "source_object_prefix" {
@@ -56,21 +56,21 @@ variable "trigger_http" {
56
56
type = bool
57
57
description = " Whether or not the trigger for this cloud function should be an HTTP endpoint"
58
58
default = true
59
- nullable = false
59
+ nullable = false
60
60
}
61
61
62
62
variable "execution_timeout" {
63
63
type = number
64
64
description = " Amount of time function can execute before timing out, in seconds"
65
65
default = 60
66
- nullable = false
66
+ nullable = false
67
67
}
68
68
69
69
variable "available_memory_mb" {
70
70
type = string
71
71
description = " Amount of memory assigned to each execution"
72
72
default = " 128M"
73
- nullable = false
73
+ nullable = false
74
74
}
75
75
76
76
variable "temp_zip_output_dir" {
Original file line number Diff line number Diff line change @@ -24,7 +24,7 @@ variable "runtime" {
24
24
type = string
25
25
description = " Function runtime, default python 3.11"
26
26
default = " python311"
27
- nullable = false
27
+ nullable = false
28
28
}
29
29
30
30
variable "source_object_prefix" {
@@ -49,21 +49,21 @@ variable "trigger_http" {
49
49
type = bool
50
50
description = " Whether or not the trigger for this cloud function should be an HTTP endpoint"
51
51
default = true
52
- nullable = false
52
+ nullable = false
53
53
}
54
54
55
55
variable "execution_timeout" {
56
56
type = number
57
57
description = " Amount of time function can execute before timing out, in seconds"
58
58
default = 60
59
- nullable = false
59
+ nullable = false
60
60
}
61
61
62
62
variable "available_memory_mb" {
63
63
type = number
64
64
description = " Amount of memory assigned to each execution"
65
65
default = 128
66
- nullable = false
66
+ nullable = false
67
67
}
68
68
69
69
variable "temp_zip_output_dir" {
You can’t perform that action at this time.
0 commit comments