terraform-provider-google/google/resource_compute_target_ssl_proxy_generated_test.go

76 lines
2.2 KiB
Go
Raw Normal View History

// ----------------------------------------------------------------------------
//
// *** AUTO GENERATED CODE *** AUTO GENERATED CODE ***
//
// ----------------------------------------------------------------------------
//
// This file is automatically generated by Magic Modules and manual
// changes will be clobbered when the file is regenerated.
//
// Please read more about how to change this file in
// .github/CONTRIBUTING.md.
//
// ----------------------------------------------------------------------------
package google
import (
"fmt"
"testing"
"github.com/hashicorp/terraform/helper/acctest"
"github.com/hashicorp/terraform/helper/resource"
)
2018-10-24 19:06:09 +00:00
func TestAccComputeTargetSslProxy_TargetSslProxyBasicExample(t *testing.T) {
t.Parallel()
resource.Test(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t) },
Providers: testAccProviders,
CheckDestroy: testAccCheckComputeTargetSslProxyDestroy,
Steps: []resource.TestStep{
{
2018-10-24 19:06:09 +00:00
Config: testAccComputeTargetSslProxy_TargetSslProxyBasicExample(acctest.RandString(10)),
},
{
ResourceName: "google_compute_target_ssl_proxy.default",
ImportState: true,
ImportStateVerify: true,
},
},
})
}
2018-10-24 19:06:09 +00:00
func testAccComputeTargetSslProxy_TargetSslProxyBasicExample(val string) string {
return fmt.Sprintf(`
resource "google_compute_target_ssl_proxy" "default" {
name = "test-proxy-%s"
backend_service = "${google_compute_backend_service.default.self_link}"
ssl_certificates = ["${google_compute_ssl_certificate.default.self_link}"]
}
resource "google_compute_ssl_certificate" "default" {
name = "default-cert-%s"
private_key = "${file("test-fixtures/ssl_cert/test.key")}"
certificate = "${file("test-fixtures/ssl_cert/test.crt")}"
}
resource "google_compute_backend_service" "default" {
name = "backend-service-%s"
protocol = "SSL"
health_checks = ["${google_compute_health_check.default.self_link}"]
}
resource "google_compute_health_check" "default" {
name = "health-check-%s"
check_interval_sec = 1
timeout_sec = 1
tcp_health_check {
port = "443"
}
}
`, val, val, val, val,
)
}