mirror of
https://github.com/letic/terraform-provider-google.git
synced 2024-09-07 01:26:43 +00:00
59 lines
1.6 KiB
Go
59 lines
1.6 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 TestAccComputeForwardingRule_forwardingRuleBasicExample(t *testing.T) {
|
|
t.Parallel()
|
|
|
|
resource.Test(t, resource.TestCase{
|
|
PreCheck: func() { testAccPreCheck(t) },
|
|
Providers: testAccProviders,
|
|
CheckDestroy: testAccCheckComputeForwardingRuleDestroy,
|
|
Steps: []resource.TestStep{
|
|
{
|
|
Config: testAccComputeForwardingRule_forwardingRuleBasicExample(acctest.RandString(10)),
|
|
},
|
|
{
|
|
ResourceName: "google_compute_forwarding_rule.default",
|
|
ImportState: true,
|
|
ImportStateVerify: true,
|
|
},
|
|
},
|
|
})
|
|
}
|
|
|
|
func testAccComputeForwardingRule_forwardingRuleBasicExample(val string) string {
|
|
return fmt.Sprintf(`
|
|
resource "google_compute_forwarding_rule" "default" {
|
|
name = "website-forwarding-rule-%s"
|
|
target = "${google_compute_target_pool.default.self_link}"
|
|
port_range = "80"
|
|
}
|
|
|
|
resource "google_compute_target_pool" "default" {
|
|
name = "website-target-pool-%s"
|
|
}
|
|
`, val, val,
|
|
)
|
|
}
|