Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions proxy/terraform/example_config.tf
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,4 @@ module "proxy" {
gcr_project_name = "YOUR_GCR_PROJECT"
proxy_domain_name = "YOUR_PROXY_DOMAIN"
proxy_certificate_bucket = "YOUR_CERTIFICATE_BUCKET"

# Uncomment to disable forwarding of whois HTTP interfaces.
# public_web_whois = 0
}
2 changes: 0 additions & 2 deletions proxy/terraform/modules/networking.tf
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ module "proxy_networking" {
proxy_ports = var.proxy_ports
proxy_domain = google_dns_managed_zone.proxy_domain.name
proxy_domain_name = google_dns_managed_zone.proxy_domain.dns_name
public_web_whois = var.public_web_whois
}

module "proxy_networking_canary" {
Expand All @@ -19,5 +18,4 @@ module "proxy_networking_canary" {
proxy_ports = var.proxy_ports_canary
proxy_domain = google_dns_managed_zone.proxy_domain.name
proxy_domain_name = google_dns_managed_zone.proxy_domain.dns_name
public_web_whois = var.public_web_whois
}
16 changes: 0 additions & 16 deletions proxy/terraform/modules/networking/dns.tf
Original file line number Diff line number Diff line change
Expand Up @@ -13,19 +13,3 @@ resource "google_dns_record_set" "proxy_epp_aaaa_record" {
managed_zone = var.proxy_domain
rrdatas = [google_compute_global_address.proxy_ipv6_address.address]
}

resource "google_dns_record_set" "proxy_whois_a_record" {
name = "whois${var.suffix}.${var.proxy_domain_name}"
type = "A"
ttl = 300
managed_zone = var.proxy_domain
rrdatas = [google_compute_global_address.proxy_ipv4_address.address]
}

resource "google_dns_record_set" "proxy_whois_aaaa_record" {
name = "whois${var.suffix}.${var.proxy_domain_name}"
type = "AAAA"
ttl = 300
managed_zone = var.proxy_domain
rrdatas = [google_compute_global_address.proxy_ipv6_address.address]
}
149 changes: 0 additions & 149 deletions proxy/terraform/modules/networking/loadbalancer.tf
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,7 @@ resource "google_compute_firewall" "proxy_firewall" {

ports = [
var.proxy_ports["epp"],
var.proxy_ports["whois"],
var.proxy_ports["health_check"],
var.proxy_ports["http-whois"],
var.proxy_ports["https-whois"],
]
}

Expand All @@ -44,21 +41,6 @@ resource "google_compute_health_check" "proxy_health_check" {
}
}

resource "google_compute_health_check" "proxy_http_health_check" {
name = "proxy-http-health-check${var.suffix}"

http_health_check {
host = "health-check.invalid"
port = var.proxy_ports["http-whois"]
request_path = "/"
}
}

resource "google_compute_url_map" "proxy_url_map" {
name = "proxy-url-map${var.suffix}"
default_service = google_compute_backend_service.http_whois_backend_service.self_link
}

resource "google_compute_backend_service" "epp_backend_service" {
name = "epp-backend-service${var.suffix}"
protocol = "TCP"
Expand All @@ -82,97 +64,12 @@ resource "google_compute_backend_service" "epp_backend_service" {
]
}

resource "google_compute_backend_service" "whois_backend_service" {
name = "whois-backend-service${var.suffix}"
protocol = "TCP"
timeout_sec = 60
port_name = "whois${var.suffix}"

backend {
group = var.proxy_instance_groups["americas"]
}

backend {
group = var.proxy_instance_groups["emea"]
}

backend {
group = var.proxy_instance_groups["apac"]
}

health_checks = [
google_compute_health_check.proxy_health_check.self_link,
]
}

resource "google_compute_backend_service" "https_whois_backend_service" {
name = "https-whois-backend-service${var.suffix}"
protocol = "TCP"
timeout_sec = 60
port_name = "https-whois${var.suffix}"

backend {
group = var.proxy_instance_groups["americas"]
}

backend {
group = var.proxy_instance_groups["emea"]
}

backend {
group = var.proxy_instance_groups["apac"]
}

health_checks = [
google_compute_health_check.proxy_health_check.self_link,
]
}

resource "google_compute_backend_service" "http_whois_backend_service" {
name = "http-whois-backend-service${var.suffix}"
protocol = "HTTP"
timeout_sec = 60
port_name = "http-whois${var.suffix}"

backend {
group = var.proxy_instance_groups["americas"]
}

backend {
group = var.proxy_instance_groups["emea"]
}

backend {
group = var.proxy_instance_groups["apac"]
}

health_checks = [
google_compute_health_check.proxy_http_health_check.self_link,
]
}

resource "google_compute_target_tcp_proxy" "epp_tcp_proxy" {
name = "epp-tcp-proxy${var.suffix}"
proxy_header = "PROXY_V1"
backend_service = google_compute_backend_service.epp_backend_service.self_link
}

resource "google_compute_target_tcp_proxy" "whois_tcp_proxy" {
name = "whois-tcp-proxy${var.suffix}"
proxy_header = "PROXY_V1"
backend_service = google_compute_backend_service.whois_backend_service.self_link
}

resource "google_compute_target_tcp_proxy" "https_whois_tcp_proxy" {
name = "https-whois-tcp-proxy${var.suffix}"
backend_service = google_compute_backend_service.https_whois_backend_service.self_link
}

resource "google_compute_target_http_proxy" "http_whois_http_proxy" {
name = "http-whois-tcp-proxy${var.suffix}"
url_map = google_compute_url_map.proxy_url_map.self_link
}

resource "google_compute_global_forwarding_rule" "epp_ipv4_forwarding_rule" {
name = "epp-ipv4-forwarding-rule${var.suffix}"
ip_address = google_compute_global_address.proxy_ipv4_address.address
Expand All @@ -186,49 +83,3 @@ resource "google_compute_global_forwarding_rule" "epp_ipv6_forwarding_rule" {
target = google_compute_target_tcp_proxy.epp_tcp_proxy.self_link
port_range = "700"
}

resource "google_compute_global_forwarding_rule" "whois_ipv4_forwarding_rule" {
name = "whois-ipv4-forwarding-rule${var.suffix}"
ip_address = google_compute_global_address.proxy_ipv4_address.address
target = google_compute_target_tcp_proxy.whois_tcp_proxy.self_link
port_range = "43"
}

resource "google_compute_global_forwarding_rule" "whois_ipv6_forwarding_rule" {
name = "whois-ipv6-forwarding-rule${var.suffix}"
ip_address = google_compute_global_address.proxy_ipv6_address.address
target = google_compute_target_tcp_proxy.whois_tcp_proxy.self_link
port_range = "43"
}

resource "google_compute_global_forwarding_rule" "https_whois_ipv4_forwarding_rule" {
name = "https-whois-ipv4-forwarding-rule${var.suffix}"
ip_address = google_compute_global_address.proxy_ipv4_address.address
target = google_compute_target_tcp_proxy.https_whois_tcp_proxy.self_link
port_range = "443"
count = var.public_web_whois
}

resource "google_compute_global_forwarding_rule" "https_whois_ipv6_forwarding_rule" {
name = "https-whois-ipv6-forwarding-rule${var.suffix}"
ip_address = google_compute_global_address.proxy_ipv6_address.address
target = google_compute_target_tcp_proxy.https_whois_tcp_proxy.self_link
port_range = "443"
count = var.public_web_whois
}

resource "google_compute_global_forwarding_rule" "http_whois_ipv4_forwarding_rule" {
name = "http-whois-ipv4-forwarding-rule${var.suffix}"
ip_address = google_compute_global_address.proxy_ipv4_address.address
target = google_compute_target_http_proxy.http_whois_http_proxy.self_link
port_range = "80"
count = var.public_web_whois
}

resource "google_compute_global_forwarding_rule" "http_whois_ipv6_forwarding_rule" {
name = "http-whois-ipv6-forwarding-rule${var.suffix}"
ip_address = google_compute_global_address.proxy_ipv6_address.address
target = google_compute_target_http_proxy.http_whois_http_proxy.self_link
port_range = "80"
count = var.public_web_whois
}
10 changes: 0 additions & 10 deletions proxy/terraform/modules/networking/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,3 @@ variable "proxy_domain" {
variable "proxy_domain_name" {
description = "Domain name of the zone."
}

variable "public_web_whois" {
type = number
description = <<EOF
Set to 1 if the whois HTTP ports are external, 0 if not. This is necessary
because our test projects are configured with
constraints/compute.restrictLoadBalancerCreationForTypes, which prohibits
forwarding external HTTP(s) connections.
EOF
}
19 changes: 1 addition & 18 deletions proxy/terraform/modules/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ variable "gcr_project_name" {

variable "proxy_domain_name" {
description = <<EOF
The base domain name of the proxy, without the whois. or epp. part.
The base domain name of the proxy, without the epp. part.
EOF
}

Expand All @@ -35,10 +35,7 @@ variable "proxy_ports" {

default = {
health_check = 30000
whois = 30001
epp = 30002
http-whois = 30010
https-whois = 30011
}
}

Expand All @@ -48,20 +45,6 @@ variable "proxy_ports_canary" {

default = {
health_check = 31000
whois = 31001
epp = 31002
http-whois = 31010
https-whois = 31011
}
}

variable "public_web_whois" {
type = number
default = 1
description = <<EOF
Set to 1 if the whois HTTP ports are external, 0 if not. This is necessary
because our test projects are configured with
constraints/compute.restrictLoadBalancerCreationForTypes, which prohibits
forwarding external HTTP(s) connections.
EOF
}
5 changes: 2 additions & 3 deletions proxy/terraform/update_named_ports.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,8 @@
# the project, zone and instance group names, and then call gcloud to add the
# named ports.

PROD_PORTS="whois:30001,epp:30002,http-whois:30010,https-whois:30011"
CANARY_PORTS="whois-canary:31001,epp-canary:31002,"\
"http-whois-canary:31010,https-whois-canary:31011"
PROD_PORTS="epp:30002"
CANARY_PORTS="epp-canary:31002"

while read line
do
Expand Down
Loading