-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvariables.tf
More file actions
144 lines (126 loc) · 3.75 KB
/
variables.tf
File metadata and controls
144 lines (126 loc) · 3.75 KB
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
variable "name" {
type = string
description = "Name of the Cloud Run service"
}
variable "gsa" {
type = string
description = "Service account name the Cloud Run service will run as. If empty, creates a new one."
}
variable "min_instances" {
type = string
default = "0"
description = "Minimum number of instances to keep running"
}
variable "max_instances" {
type = string
default = "100"
description = "Maximum number of instances to scale to"
}
variable "regions" {
type = list(string)
description = "The GCP region(s) to deploy to"
default = [
"us-east4",
"us-east5",
"us-central1",
"us-west3",
"us-west1",
"us-west4",
"us-south1",
"northamerica-northeast1",
"northamerica-northeast2",
"northamerica-south1",
"australia-southeast1",
"australia-southeast2"
]
}
variable "project" {
type = string
description = "The GCP project to use"
}
variable "skipNeg" {
type = bool
default = false
description = "Skip creating Network Endpoint Group and Backend Service"
}
variable "invokers" {
type = list(string)
default = ["allUsers"]
description = "List of members to grant Cloud Run invoker role"
}
variable "secrets" {
type = list(object({
name = string
secret_id = string
secret_name = string
}))
default = []
description = "List of Secret Manager secrets to mount as environment variables"
}
variable "containers" {
type = list(object({
image = string
name = string
command = optional(list(string), null)
args = optional(list(string), null)
port = optional(number, 0)
memory = optional(string, "512Mi")
cpu = optional(string, "1000m")
liveness_probe = optional(string, "")
gpus = optional(string, "")
volume_mounts = optional(list(object({
name = string
mount_path = string
})), [])
}))
description = "List of container configurations to run in the service. At least one container needs a port. This allows easily configuring multi-container deployments."
}
variable "addl_env_vars" {
type = list(object({
name = string
value = string
}))
default = []
description = "Additional environment variables to set in containers"
}
variable "empty_dir_volumes" {
type = list(object({
name = string
size_limit = optional(string, "2Mi")
}))
default = []
description = "List of empty directory volumes to create and mount"
}
variable "gcs_volumes" {
type = list(object({
name = string
bucket = string
read_only = optional(bool, true)
}))
default = []
description = "List of Google Cloud Storage buckets to mount as volumes. Must ensure the Cloud Run GSA has proper IAM set on the bucket"
}
variable "vpc_direct_egress" {
type = string
description = "Traffic VPC egress settings. Possible values are: `ALL_TRAFFIC`, `PRIVATE_RANGES_ONLY`."
default = "OFF"
validation {
condition = contains(["OFF", "ALL_TRAFFIC", "PRIVATE_RANGES_ONLY"], var.vpc_direct_egress)
error_message = "The 'vpc_direct_egress' variable must be one of 'ALL_TRAFFIC' or 'PRIVATE_RANGES_ONLY'"
}
}
variable "vpc_direct_egress_network" {
type = string
description = "The VPC network that the Cloud Run resource will be able to send traffic to"
default = "default"
}
variable "vpc_direct_egress_subnetwork" {
type = string
default = "default"
description = "The VPC subnetwork that the Cloud Run resource will get IPs from"
}
variable "vpc_direct_egress_tags" {
type = list(string)
default = null
description = "Network tags applied to this Cloud Run service"
}