-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvariables.tf
More file actions
193 lines (166 loc) · 5.37 KB
/
variables.tf
File metadata and controls
193 lines (166 loc) · 5.37 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
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
variable "project_id" {
description = "The GCP project ID"
type = string
}
variable "project_number" {
type = string
description = "The GCP project number"
}
variable "region" {
description = "GCP region for resources"
type = string
default = "us-east5"
}
variable "zone" {
description = "GCP zone for resources"
type = string
default = "us-east5-b"
}
variable "name" {
type = string
description = "The site name (will be the name of the GCP instance)"
}
variable "disk_type" {
type = string
description = "The disk type for disks attached to the machine"
default = "hyperdisk-balanced"
validation {
condition = contains([
"hyperdisk-balanced",
"pd-ssd",
"pd-standard",
], var.disk_type)
error_message = "Invalid 'disk_type'"
}
}
variable "machine_type" {
type = string
default = "n4-standard-2"
description = "VM machine type (General-purpose series that support Hyperdisk Balanced"
validation {
condition = contains([
"e2-micro",
"e2-small",
"e2-medium",
"n4-standard-2",
"n4-standard-4",
"n4-standard-8",
"n4-standard-16",
"n4-standard-32",
"n4-standard-48",
"n4-standard-64",
"n4-standard-80",
"c4-standard-2",
"c4-standard-4",
"c4-standard-8",
"c4-standard-16",
"c4-standard-32",
"c4-standard-48",
"c4-standard-96",
], var.machine_type)
error_message = "The 'machine_type' must be from a General-Purpose family that supports Hyperdisk Balanced (C4, or N4 series)"
}
}
variable "ingress_port" {
type = number
default = 80
description = "TCP port on the VM that the Cloud Run ingress should connect to."
}
variable "disk_size_gb" {
type = number
default = 50
description = "Data disk size in GB"
}
variable "os" {
type = string
default = "cos-125-19216-104-74"
description = "The host OS to install on the GCP instance"
}
variable "docker_compose_repo" {
type = string
description = "git repo to checkout that contains a docker compose project"
}
variable "docker_compose_branch" {
type = string
default = "main"
description = "git branch to checkout for var.docker_compose_repo"
}
variable "docker_compose_init" {
type = list(string)
default = []
description = "After cloning the docker compose git repo, any initialization that needs to happen before the docker compose project can start. One command per list value"
}
variable "docker_compose_up" {
type = list(string)
default = [
"docker compose up --remove-orphans"
]
description = "Command to start the docker compose project"
}
variable "docker_compose_down" {
type = list(string)
default = [
"docker compose down"
]
description = "Command to stop the docker compose project"
}
variable "allowed_ips" {
type = list(string)
default = []
description = "CIDR IP Addresses allowed to turn on this site's GCP instance"
}
variable "allowed_ssh_ipv4" {
type = list(string)
default = []
description = "CIDR IPv4 Addresses allowed to to SSH into this site's GCP instance"
}
variable "allowed_ssh_ipv6" {
type = list(string)
default = []
description = "CIDR IPv6 Addresses allowed to SSH into this site's GCP instance"
}
variable "run_snapshots" {
type = bool
default = false
description = "Enable daily snapshots of the data disk (recommended for production). Last seven days of snapshots are available. Also weekly snapshots for past year."
}
variable "overlay_source_instance" {
type = string
default = ""
description = "Name of production instance to get latest snapshot from (e.g., 'ojs-production'). Terraform will automatically use the most recent snapshot from this instance's data disk. Leave empty for production environments."
}
variable "volume_names" {
type = list(string)
default = []
description = "List of docker volumes to overlay from production snapshot (e.g., ['compose_ojs-public']). Production data is mounted read-only as lower layer, staging writes go to upper layer."
}
variable "users" {
type = map(list(string))
default = {}
description = "Map of usernames to lists of SSH public keys. Users will be created with docker group membership. Example: { \"alice\" = [\"ssh-rsa AAAA...\"], \"bob\" = [\"ssh-ed25519 AAAA...\", \"ssh-rsa BBBB...\"] }"
}
variable "rootfs" {
type = string
default = ""
description = "Path to additional rootfs files to copy into the VM. Files will be merged with the base rootfs. Example: '/path/to/custom/rootfs'"
}
variable "runcmd" {
type = list(string)
default = []
description = "Additional commands to run during cloud-init. Commands are executed after the main initialization."
}
variable "initcmd" {
type = list(string)
default = []
description = "Commands to run before /home/cloud-compose/run.sh"
}
variable "artifact_registry_repository" {
type = string
default = ""
description = "Optional Artifact Registry repository name to grant the VM service account reader access to. Leave empty to skip creating the IAM binding."
}
variable "artifact_registry_location" {
type = string
default = "us"
description = "Artifact Registry location for var.artifact_registry_repository."
}