-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathsetup_gcp_terraform.tf
316 lines (301 loc) · 10.6 KB
/
setup_gcp_terraform.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
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
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
provider "google" {
project = "label-studio-424123"
region = "us-central1"
}
resource "google_project" "default" {
auto_create_network = true
billing_account = "01DC86-694FD7-874183"
folder_id = null
labels = {}
name = "Label Studio"
org_id = jsonencode(115681881384)
project_id = "label-studio-424123"
skip_delete = null
}
resource "google_service_account" "default" {
account_id = "label-studio-user"
create_ignore_already_exists = null
description = "A service account for running Label Studio, and related CI/CD"
disabled = false
display_name = "label-studio-user"
project = "label-studio-424123"
}
# __generated__ by Terraform from "label-studio-424123 roles/logging.bucketWriter serviceAccount:[email protected]"
resource "google_project_iam_member" "bucketWriter" {
member = "serviceAccount:[email protected]"
project = "label-studio-424123"
role = "roles/logging.bucketWriter"
}
# __generated__ by Terraform from "label-studio-424123 roles/secretmanager.secretAccessor serviceAccount:[email protected]"
resource "google_project_iam_member" "secretAccessor" {
member = "serviceAccount:[email protected]"
project = "label-studio-424123"
role = "roles/secretmanager.secretAccessor"
}
# __generated__ by Terraform from "label-studio-424123 roles/cloudsql.client serviceAccount:[email protected]"
resource "google_project_iam_member" "cloudsql" {
member = "serviceAccount:[email protected]"
project = "label-studio-424123"
role = "roles/cloudsql.client"
}
# __generated__ by Terraform from "label-studio-424123 roles/artifactregistry.repoAdmin serviceAccount:[email protected]"
resource "google_project_iam_member" "artifactregistry" {
member = "serviceAccount:[email protected]"
project = "label-studio-424123"
role = "roles/artifactregistry.repoAdmin"
}
# __generated__ by Terraform from "label-studio-424123 roles/logging.logWriter serviceAccount:[email protected]"
resource "google_project_iam_member" "logWriter" {
member = "serviceAccount:[email protected]"
project = "label-studio-424123"
role = "roles/logging.logWriter"
}
# __generated__ by Terraform from "label-studio-424123 roles/iam.serviceAccountTokenCreator serviceAccount:[email protected]"
resource "google_project_iam_member" "serviceAccountTokenCreator" {
member = "serviceAccount:[email protected]"
project = "label-studio-424123"
role = "roles/iam.serviceAccountTokenCreator"
}
# __generated__ by Terraform from "label-studio-424123 roles/storage.admin serviceAccount:[email protected]"
resource "google_project_iam_member" "storage" {
member = "serviceAccount:[email protected]"
project = "label-studio-424123"
role = "roles/storage.admin"
}
resource "google_sql_database_instance" "default" {
database_version = "POSTGRES_15"
deletion_protection = true
encryption_key_name = null
instance_type = "CLOUD_SQL_INSTANCE"
maintenance_version = "POSTGRES_15_7.R20240514.00_04"
master_instance_name = null
name = "label-studio-postgres"
project = "label-studio-424123"
region = "us-central1"
root_password = null # sensitive
settings {
activation_policy = "ALWAYS"
availability_type = "ZONAL"
collation = null
connector_enforcement = "NOT_REQUIRED"
deletion_protection_enabled = true
disk_autoresize = true
disk_autoresize_limit = 0
disk_size = 20
disk_type = "PD_SSD"
edition = "ENTERPRISE"
enable_google_ml_integration = false
pricing_plan = "PER_USE"
tier = "db-custom-2-8192"
time_zone = null
user_labels = {}
backup_configuration {
binary_log_enabled = false
enabled = true
location = "us"
point_in_time_recovery_enabled = true
start_time = "21:00"
transaction_log_retention_days = 4
backup_retention_settings {
retained_backups = 4
retention_unit = "COUNT"
}
}
insights_config {
query_insights_enabled = true
query_plans_per_minute = 5
query_string_length = 1024
record_application_tags = false
record_client_address = false
}
ip_configuration {
allocated_ip_range = null
enable_private_path_for_google_cloud_services = false
ipv4_enabled = true
private_network = null
ssl_mode = null
}
location_preference {
follow_gae_application = null
secondary_zone = null
zone = "us-central1-c"
}
maintenance_window {
day = 1
hour = 1
update_track = null
}
}
}
resource "google_sql_database" "default" {
charset = "UTF8"
collation = "en_US.UTF8"
deletion_policy = "DELETE"
instance = "label-studio-postgres"
name = "postgres"
project = "label-studio-424123"
}
resource "google_artifact_registry_repository" "default" {
cleanup_policy_dry_run = true
description = "images for Label Studio's container"
format = "DOCKER"
kms_key_name = null
labels = {}
location = "us-central1"
mode = "STANDARD_REPOSITORY"
project = "label-studio-424123"
repository_id = "label-studio"
docker_config {
immutable_tags = false
}
}
resource "google_storage_bucket" "default2" {
default_event_based_hold = false
enable_object_retention = false
force_destroy = false
labels = {}
location = "US"
name = "label-studio-input-open-paws"
project = "label-studio-424123"
public_access_prevention = "enforced"
requester_pays = false
rpo = "DEFAULT"
storage_class = "STANDARD"
uniform_bucket_level_access = true
soft_delete_policy {
retention_duration_seconds = 604800
}
}
# __generated__ by Terraform from "label-studio-424123/label-studio-output"
resource "google_storage_bucket" "default1" {
default_event_based_hold = false
enable_object_retention = false
force_destroy = false
labels = {}
location = "US"
name = "label-studio-output"
project = "label-studio-424123"
public_access_prevention = "enforced"
requester_pays = false
rpo = "DEFAULT"
storage_class = "STANDARD"
uniform_bucket_level_access = true
soft_delete_policy {
retention_duration_seconds = 604800
}
}
resource "google_cloud_run_v2_service" "default" {
annotations = {}
client = "cloud-console"
client_version = null
custom_audiences = []
description = null
ingress = "INGRESS_TRAFFIC_ALL"
labels = {}
launch_stage = "BETA"
location = "us-central1"
name = "human-feedback-label-studio"
project = "label-studio-424123"
template {
annotations = {}
encryption_key = null
execution_environment = null
labels = {}
max_instance_request_concurrency = 80
revision = null
service_account = "[email protected]"
session_affinity = false
timeout = "300s"
containers {
args = []
command = []
depends_on = []
image = "us-central1-docker.pkg.dev/label-studio-424123/label-studio/label-studio:latest"
name = "placeholder-1"
working_dir = null
env {
name = "USERNAME"
value = "[email protected]"
}
env {
name = "PASSWORD"
value = "Op3np@ws1234"
}
env {
name = "DISABLE_SIGNUP_WITHOUT_LINK"
value = jsonencode(0)
}
env {
name = "DJANGO_DB"
value = "default"
}
env {
name = "POSTGRE_NAME"
value = "postgres"
}
env {
name = "POSTGRE_USER"
value = "postgres"
}
env {
name = "POSTGRE_HOST"
value = "/cloudsql/label-studio-424123:us-central1:label-studio-postgres"
}
env {
name = "POSTGRE_PORT"
value = jsonencode(5432)
}
env {
name = "POSTGRE_PASSWORD"
value = null
value_source {
secret_key_ref {
secret = "label-studio-postgres-admin"
version = "latest"
}
}
}
ports {
container_port = 8080
name = "http1"
}
resources {
cpu_idle = true
limits = {
cpu = "1000m"
memory = "512Mi"
}
startup_cpu_boost = true
}
startup_probe {
failure_threshold = 1
initial_delay_seconds = 0
period_seconds = 240
timeout_seconds = 240
tcp_socket {
port = 8080
}
}
volume_mounts {
mount_path = "/cloudsql"
name = "cloudsql"
}
}
scaling {
max_instance_count = 100
min_instance_count = 0
}
volumes {
name = "cloudsql"
cloud_sql_instance {
instances = ["label-studio-424123:us-central1:label-studio-postgres"]
}
}
}
traffic {
percent = 100
revision = null
tag = null
type = "TRAFFIC_TARGET_ALLOCATION_TYPE_LATEST"
}
}