mirror of
https://github.com/letic/terraform-provider-google.git
synced 2024-09-07 09:36:44 +00:00
70 lines
1.7 KiB
Go
70 lines
1.7 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 TestAccComputeRouter_routerBasicExample(t *testing.T) {
|
||
|
t.Parallel()
|
||
|
|
||
|
resource.Test(t, resource.TestCase{
|
||
|
PreCheck: func() { testAccPreCheck(t) },
|
||
|
Providers: testAccProviders,
|
||
|
CheckDestroy: testAccCheckComputeRouterDestroy,
|
||
|
Steps: []resource.TestStep{
|
||
|
{
|
||
|
Config: testAccComputeRouter_routerBasicExample(acctest.RandString(10)),
|
||
|
},
|
||
|
{
|
||
|
ResourceName: "google_compute_router.foobar",
|
||
|
ImportState: true,
|
||
|
ImportStateVerify: true,
|
||
|
},
|
||
|
},
|
||
|
})
|
||
|
}
|
||
|
|
||
|
func testAccComputeRouter_routerBasicExample(val string) string {
|
||
|
return fmt.Sprintf(`
|
||
|
resource "google_compute_router" "foobar" {
|
||
|
name = "my-router-%s"
|
||
|
network = "${google_compute_network.foobar.name}"
|
||
|
bgp {
|
||
|
asn = 64514
|
||
|
advertise_mode = "CUSTOM"
|
||
|
advertised_groups = ["ALL_SUBNETS"]
|
||
|
advertised_ip_ranges {
|
||
|
range = "1.2.3.4"
|
||
|
}
|
||
|
advertised_ip_ranges {
|
||
|
range = "6.7.0.0/16"
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
|
||
|
resource "google_compute_network" "foobar" {
|
||
|
name = "my-network-%s"
|
||
|
auto_create_subnetworks = false
|
||
|
}
|
||
|
`, val, val,
|
||
|
)
|
||
|
}
|