-
Notifications
You must be signed in to change notification settings - Fork 0
/
lb.tf
52 lines (42 loc) · 1.18 KB
/
lb.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
module "load_balancer" {
source = "GoogleCloudPlatform/lb-http/google//modules/serverless_negs"
version = "10.0.0"
project = var.project_id
name = "endpoint-${var.backend_name}"
ssl = true
ssl_policy = google_compute_ssl_policy.main.id
random_certificate_suffix = true # In case the domain changes
managed_ssl_certificate_domains = [var.pohttp_server_domain]
backends = {
default = {
description = null
groups = [
{
group = google_compute_region_network_endpoint_group.main.id
}
]
enable_cdn = false
iap_config = {
enable = false
}
log_config = {
enable = false
}
}
}
http_forward = false
}
resource "google_compute_ssl_policy" "main" {
name = "endpoint-${var.backend_name}"
profile = "MODERN"
min_tls_version = "TLS_1_2"
}
resource "google_compute_region_network_endpoint_group" "main" {
project = var.project_id
region = var.region
name = "endpoint-${var.backend_name}"
network_endpoint_type = "SERVERLESS"
cloud_run {
service = google_cloud_run_v2_service.pohttp_server.name
}
}