-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcloudrun.tf
147 lines (121 loc) · 3.28 KB
/
cloudrun.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
# Enable Cloud Run API
resource "google_project_service" "cloudrun-api" {
service = "run.googleapis.com"
disable_on_destroy = false
}
# Setup Variable for GeoCore Version
variable "geocore_version" {
type = string
description = "GeoCore Version Tag"
}
# Setup Variable for GCP Project ID
variable "maps_apikey" {
type = string
description = "Google Maps Platform API Key"
sensitive = true
}
# Configure Cloud Run Service geocore-spatio. Assumes container image is already deployed
# terraform import google_cloud_run_service.geocore-spatio <region>/geocore-spatio
resource "google_cloud_run_service" "geocore-spatio" {
name = "geocore-spatio"
location = var.region
template {
spec {
container_concurrency = 5
timeout_seconds = 60
service_account_name = "${google_service_account.geocore-spatio.email}"
containers {
args = []
command = []
image = format("%s-docker.pkg.dev/%s/geocore/geocore-spatio:%s", var.region, var.project, var.geocore_version)
env {
name = "GCP_PROJECT"
value = var.project
}
env {
name = "GCP_REGION"
value = var.region
}
env {
name = "MAPS_APIKEY"
value = var.maps_apikey
}
}
}
}
lifecycle {
ignore_changes = [
template[0].metadata
]
}
}
# Configure Cloud Run Service geocore-chrono. Assumes container image is already deployed
# terraform import google_cloud_run_service.geocore-chrono <region>/geocore-chrono
resource "google_cloud_run_service" "geocore-chrono" {
name = "geocore-chrono"
location = var.region
template {
spec {
container_concurrency = 5
timeout_seconds = 60
service_account_name = "${google_service_account.geocore-chrono.email}"
containers {
args = []
command = []
image = format("%s-docker.pkg.dev/%s/geocore/geocore-chrono:%s", var.region, var.project, var.geocore_version)
env {
name = "GCP_PROJECT"
value = var.project
}
env {
name = "GCP_REGION"
value = var.region
}
env {
name = "MAPS_APIKEY"
value = var.maps_apikey
}
}
}
}
lifecycle {
ignore_changes = [
template[0].metadata
]
}
}
# Configure Cloud Run Service geocore-raster. Assumes container image is already deployed
# terraform import google_cloud_run_service.geocore-raster <region>/geocore-raster
resource "google_cloud_run_service" "geocore-raster" {
name = "geocore-raster"
location = var.region
template {
spec {
container_concurrency = 5
timeout_seconds = 60
service_account_name = "${google_service_account.geocore-raster.email}"
containers {
args = []
command = []
image = format("%s-docker.pkg.dev/%s/geocore/geocore-raster:%s", var.region, var.project, var.geocore_version)
env {
name = "GCP_PROJECT"
value = var.project
}
env {
name = "GCP_REGION"
value = var.region
}
env {
name = "MAPS_APIKEY"
value = var.maps_apikey
}
}
}
}
lifecycle {
ignore_changes = [
template[0].metadata
]
}
}