google_compute_target_ssl_proxy

Represents a TargetSslProxy resource, which is used by one or more global forwarding rule to route incoming SSL requests to a backend service.

To get more information about TargetSslProxy, see:

Open in Cloud Shell

Example Usage - Target Ssl Proxy Basic

resource "google_compute_target_ssl_proxy" "default" {
  name             = "test-proxy"
  backend_service  = google_compute_backend_service.default.id
  ssl_certificates = [google_compute_ssl_certificate.default.id]
}

resource "google_compute_ssl_certificate" "default" {
  name        = "default-cert"
  private_key = file("path/to/private.key")
  certificate = file("path/to/certificate.crt")
}

resource "google_compute_backend_service" "default" {
  name          = "backend-service"
  protocol      = "SSL"
  health_checks = [google_compute_health_check.default.id]
}

resource "google_compute_health_check" "default" {
  name               = "health-check"
  check_interval_sec = 1
  timeout_sec        = 1
  tcp_health_check {
    port = "443"
  }
}

Argument Reference

The following arguments are supported:


Attributes Reference

In addition to the arguments listed above, the following computed attributes are exported:

Timeouts

This resource provides the following Timeouts configuration options:

Import

TargetSslProxy can be imported using any of these accepted formats:

In Terraform v1.5.0 and later, use an import block to import TargetSslProxy using one of the formats above. For example:

import {
  id = "projects/{{project}}/global/targetSslProxies/{{name}}"
  to = google_compute_target_ssl_proxy.default
}

When using the terraform import command, TargetSslProxy can be imported using one of the formats above. For example:

$ terraform import google_compute_target_ssl_proxy.default projects/{{project}}/global/targetSslProxies/{{name}}
$ terraform import google_compute_target_ssl_proxy.default {{project}}/{{name}}
$ terraform import google_compute_target_ssl_proxy.default {{name}}

User Project Overrides

This resource supports User Project Overrides.