-
Notifications
You must be signed in to change notification settings - Fork 86
/
Copy pathmain.tf
49 lines (40 loc) · 1.36 KB
/
main.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
resource "google_compute_target_https_proxy" "default" {
name = "test-proxy-${local.name_suffix}"
url_map = google_compute_url_map.default.id
ssl_certificates = [google_compute_ssl_certificate.default.id]
}
resource "google_compute_ssl_certificate" "default" {
name = "my-certificate-${local.name_suffix}"
private_key = file("../static/ssl_cert/test.key")
certificate = file("../static/ssl_cert/test.crt")
}
resource "google_compute_url_map" "default" {
name = "url-map-${local.name_suffix}"
description = "a description"
default_service = google_compute_backend_service.default.id
host_rule {
hosts = ["mysite.com"]
path_matcher = "allpaths"
}
path_matcher {
name = "allpaths"
default_service = google_compute_backend_service.default.id
path_rule {
paths = ["/*"]
service = google_compute_backend_service.default.id
}
}
}
resource "google_compute_backend_service" "default" {
name = "backend-service-${local.name_suffix}"
port_name = "http"
protocol = "HTTP"
timeout_sec = 10
health_checks = [google_compute_http_health_check.default.id]
}
resource "google_compute_http_health_check" "default" {
name = "http-health-check-${local.name_suffix}"
request_path = "/"
check_interval_sec = 1
timeout_sec = 1
}