mirror of
https://github.com/letic/terraform-provider-google.git
synced 2024-10-07 11:11:13 +00:00
68 lines
1.8 KiB
Go
68 lines
1.8 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 TestAccComputeRoute_routeBasicExample(t *testing.T) {
|
||
|
t.Parallel()
|
||
|
|
||
|
resource.Test(t, resource.TestCase{
|
||
|
PreCheck: func() { testAccPreCheck(t) },
|
||
|
Providers: testAccProviders,
|
||
|
CheckDestroy: testAccCheckComputeRouteDestroy,
|
||
|
Steps: []resource.TestStep{
|
||
|
{
|
||
|
Config: testAccComputeRoute_routeBasicExample(acctest.RandString(10)),
|
||
|
},
|
||
|
{
|
||
|
ResourceName: "google_compute_route.default",
|
||
|
ImportState: true,
|
||
|
ImportStateVerify: true,
|
||
|
},
|
||
|
},
|
||
|
})
|
||
|
}
|
||
|
|
||
|
func testAccComputeRoute_routeBasicExample(val string) string {
|
||
|
return fmt.Sprintf(`
|
||
|
resource "google_compute_route" "default" {
|
||
|
name = "network-route-%s"
|
||
|
dest_range = "15.0.0.0/24"
|
||
|
network = "${google_compute_network.default.name}"
|
||
|
next_hop_ip = "10.0.1.5"
|
||
|
priority = 100
|
||
|
}
|
||
|
|
||
|
resource "google_compute_network" "default" {
|
||
|
name = "compute-network-%s"
|
||
|
}
|
||
|
|
||
|
resource "google_compute_subnetwork" "default" {
|
||
|
name = "compute-subnetwork-%s"
|
||
|
ip_cidr_range = "10.0.0.0/16"
|
||
|
network = "${google_compute_network.default.self_link}"
|
||
|
region = "us-central1"
|
||
|
}
|
||
|
`, val, val, val,
|
||
|
)
|
||
|
}
|