-
Notifications
You must be signed in to change notification settings - Fork 0
/
pong.tf
98 lines (80 loc) · 1.89 KB
/
pong.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
locals {
awala_pong_version = "4.0.2"
}
resource "google_service_account" "pong" {
project = var.google_project_id
account_id = "awala-pong"
display_name = "Awala Pong"
}
resource "google_cloud_run_v2_service" "pong" {
project = var.google_project_id
location = var.google_region
name = "awala-pong"
ingress = "INGRESS_TRAFFIC_INTERNAL_ONLY"
template {
timeout = "300s"
service_account = google_service_account.pong.email
execution_environment = "EXECUTION_ENVIRONMENT_GEN2"
max_instance_request_concurrency = 100
containers {
name = "pong"
image = "relaycorp/awala-pong:${local.awala_pong_version}"
env {
name = "VERSION"
value = local.awala_pong_version
}
env {
name = "LOG_LEVEL"
value = "info"
}
env {
name = "LOG_TARGET"
value = "gcp"
}
env {
name = "REQUEST_ID_HEADER"
value = "X-Cloud-Trace-Context"
}
env {
name = "CE_TRANSPORT"
value = "google-pubsub"
}
env {
name = "CE_CHANNEL"
value = module.self.pubsub_topics.outgoing_messages
}
resources {
startup_cpu_boost = true
cpu_idle = false
limits = {
cpu = 1
memory = "512Mi"
}
}
startup_probe {
initial_delay_seconds = 3
failure_threshold = 3
period_seconds = 10
timeout_seconds = 3
http_get {
path = "/"
port = 8080
}
}
liveness_probe {
initial_delay_seconds = 0
failure_threshold = 3
period_seconds = 20
timeout_seconds = 3
http_get {
path = "/"
port = 8080
}
}
}
scaling {
min_instance_count = 1
max_instance_count = 3
}
}
}