mirror of
https://github.com/letic/terraform-provider-google.git
synced 2024-09-07 09:36:44 +00:00
72 lines
1.9 KiB
Go
72 lines
1.9 KiB
Go
// ----------------------------------------------------------------------------
|
|
//
|
|
// *** 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"
|
|
)
|
|
|
|
func TestAccComputeTargetTcpProxy_targetTcpProxyBasicExample(t *testing.T) {
|
|
t.Parallel()
|
|
|
|
resource.Test(t, resource.TestCase{
|
|
PreCheck: func() { testAccPreCheck(t) },
|
|
Providers: testAccProviders,
|
|
CheckDestroy: testAccCheckComputeTargetTcpProxyDestroy,
|
|
Steps: []resource.TestStep{
|
|
{
|
|
Config: testAccComputeTargetTcpProxy_targetTcpProxyBasicExample(acctest.RandString(10)),
|
|
},
|
|
{
|
|
ResourceName: "google_compute_target_tcp_proxy.default",
|
|
ImportState: true,
|
|
ImportStateVerify: true,
|
|
},
|
|
},
|
|
})
|
|
}
|
|
|
|
func testAccComputeTargetTcpProxy_targetTcpProxyBasicExample(val string) string {
|
|
return fmt.Sprintf(`
|
|
resource "google_compute_target_tcp_proxy" "default" {
|
|
name = "test-proxy-%s"
|
|
backend_service = "${google_compute_backend_service.default.self_link}"
|
|
}
|
|
|
|
resource "google_compute_backend_service" "default" {
|
|
name = "backend-service-%s"
|
|
protocol = "TCP"
|
|
timeout_sec = 10
|
|
|
|
health_checks = ["${google_compute_health_check.default.self_link}"]
|
|
}
|
|
|
|
resource "google_compute_health_check" "default" {
|
|
name = "health-check-%s"
|
|
timeout_sec = 1
|
|
check_interval_sec = 1
|
|
|
|
tcp_health_check {
|
|
port = "443"
|
|
}
|
|
}
|
|
`, val, val, val,
|
|
)
|
|
}
|