-
Notifications
You must be signed in to change notification settings - Fork 0
/
variables.tf
157 lines (142 loc) · 4.55 KB
/
variables.tf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
/**
* Copyright 2021 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
variable "project_id" {
description = "Project ID to create Cloud Function"
type = string
}
variable "function_name" {
description = "A user-defined name of the function"
type = string
}
variable "function_location" {
description = "The location of this cloud function"
type = string
}
variable "description" {
description = "Short description of the function"
type = string
default = null
}
variable "labels" {
description = "A set of key/value label pairs associated with this Cloud Function"
type = map(string)
default = null
}
variable "runtime" {
description = "The runtime in which to run the function."
type = string
}
variable "entrypoint" {
description = "The name of the function (as defined in source code) that will be executed. Defaults to the resource name suffix, if not specified"
type = string
}
variable "build_env_variables" {
description = "User-provided build-time environment variables"
type = map(string)
default = null
}
variable "worker_pool" {
description = "Name of the Cloud Build Custom Worker Pool that should be used to build the function."
type = string
default = null
}
variable "docker_repository" {
description = "User managed repository created in Artifact Registry optionally with a customer managed encryption key."
type = string
default = null
}
variable "storage_source" {
description = "Get the source from this location in Google Cloud Storage"
type = object({
bucket = string
object = string
generation = optional(string, null)
})
default = null
}
variable "repo_source" {
description = "Get the source from this location in a Cloud Source Repository"
type = object({
project_id = optional(string)
repo_name = string
branch_name = string
dir = optional(string)
tag_name = optional(string)
commit_sha = optional(string)
invert_regex = optional(bool, false)
})
default = null
}
variable "event_trigger" {
description = "Event triggers for the function"
type = object({
trigger_region = optional(string)
event_type = string
service_account_email = string
pubsub_topic = optional(string)
retry_policy = string
event_filters = optional(set(object({
attribute = string
attribute_value = string
operator = optional(string)
})))
})
default = null
}
variable "service_config" {
description = "Details of the service"
type = object({
max_instance_count = optional(string, 100)
min_instance_count = optional(string, 1)
available_memory = optional(string, "256M")
available_cpu = optional(string, 1)
timeout_seconds = optional(string, 60)
runtime_env_variables = optional(map(string), null)
runtime_secret_env_variables = optional(set(object({
key_name = string
project_id = optional(string)
secret = string
version = string
})), null)
secret_volumes = optional(set(object({
mount_path = string
project_id = optional(string)
secret = string
versions = set(object({
version = string
path = string
}))
})), null)
vpc_connector = optional(string, null)
vpc_connector_egress_settings = optional(string, null)
ingress_settings = optional(string, null)
service_account_email = optional(string, null)
all_traffic_on_latest_revision = optional(bool, true)
})
default = {}
}
// IAM
variable "members" {
type = map(list(string))
description = "Cloud Function Invoker and Developer roles for Users/SAs. Key names must be developers and/or invokers"
default = {}
validation {
condition = alltrue([
for key in keys(var.members) : contains(["invokers", "developers"], key)
])
error_message = "The supported keys are invokers and developers."
}
}