-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathserver.tf
57 lines (50 loc) · 1.32 KB
/
server.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
resource "google_cloud_run_service" "application_server" {
name = "${local.common_project_name}-server"
location = local.region
template {
spec {
containers {
image = local.server_image
ports {
container_port = 8080
}
resources {
limits = {
memory = "2Gi"
cpu = "2"
}
}
}
}
metadata {
annotations = {
"autoscaling.knative.dev/maxScale" = "2"
"run.googleapis.com/cloudsql-instances" = google_sql_database_instance.postgres_instance.connection_name
"run.googleapis.com/client-name" = "terraform"
}
}
}
traffic {
percent = 100
latest_revision = true
}
autogenerate_revision_name = true
}
#resource "google_cloud_run_domain_mapping" "api_debate_com" {
# name = "api.debate.com"
# location = google_cloud_run_service.application_server.location
# service = google_cloud_run_service.application_server.name
#
# depends_on = [google_cloud_run_service.application_server]
#}
#
#resource "google_dns_record_set" "api_debate_com" {
# name = "api.debate.com."
# managed_zone = "debate-zone"
# type = "CNAME"
# ttl = 300
#
# rrdatas = [
# google_cloud_run_service.application_server.status[0].url,
# ]
#}