Skip to content

Commit

Permalink
Update API default change date for VPC Native GKE (#496)
Browse files Browse the repository at this point in the history
<!-- This change is generated by MagicModules. -->
/cc @rileykarson
  • Loading branch information
modular-magician authored and rileykarson committed Mar 4, 2019
1 parent c34fa6d commit ce1b1f4
Show file tree
Hide file tree
Showing 15 changed files with 59 additions and 509 deletions.
9 changes: 0 additions & 9 deletions google-beta/provider_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ import (
)

var testAccProviders map[string]terraform.ResourceProvider
var testAccProvidersOiCS map[string]terraform.ResourceProvider
var testAccProvider *schema.Provider
var testAccRandomProvider *schema.Provider

Expand Down Expand Up @@ -65,14 +64,6 @@ func init() {
"google": testAccProvider,
"random": testAccRandomProvider,
}

// The OiCS provider map is used to ensure that OiCS examples use `google-beta`
// if the example is versioned as beta; normal beta tests should continue to
// use the standard provider map.
testAccProvidersOiCS = map[string]terraform.ResourceProvider{
"google-beta": testAccProvider,
"random": testAccRandomProvider,
}
}

func TestProvider(t *testing.T) {
Expand Down
47 changes: 21 additions & 26 deletions google-beta/resource_cloud_scheduler_job_generated_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,27 +33,29 @@ func TestAccCloudSchedulerJob_schedulerJobPubsubExample(t *testing.T) {

resource.Test(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t) },
Providers: testAccProvidersOiCS,
Providers: testAccProviders,
CheckDestroy: testAccCheckCloudSchedulerJobDestroy,
Steps: []resource.TestStep{
{
Config: testAccCloudSchedulerJob_schedulerJobPubsubExample(context),
},
{
ResourceName: "google_cloud_scheduler_job.job",
ImportState: true,
ImportStateVerify: true,
ImportStateVerifyIgnore: []string{"region"},
},
},
})
}

func testAccCloudSchedulerJob_schedulerJobPubsubExample(context map[string]interface{}) string {
return Nprintf(`
resource "google_pubsub_topic" "topic" {
provider = "google-beta"
name = "job-topic-%{random_suffix}"
}
resource "google_cloud_scheduler_job" "job" {
provider = "google-beta"
name = "test-job-%{random_suffix}"
description = "test job"
schedule = "*/2 * * * *"
Expand All @@ -63,11 +65,6 @@ resource "google_cloud_scheduler_job" "job" {
data = "${base64encode("test")}"
}
}
provider "google-beta"{
region = "us-central1"
zone = "us-central1-a"
}
`, context)
}

Expand All @@ -80,21 +77,25 @@ func TestAccCloudSchedulerJob_schedulerJobHttpExample(t *testing.T) {

resource.Test(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t) },
Providers: testAccProvidersOiCS,
Providers: testAccProviders,
CheckDestroy: testAccCheckCloudSchedulerJobDestroy,
Steps: []resource.TestStep{
{
Config: testAccCloudSchedulerJob_schedulerJobHttpExample(context),
},
{
ResourceName: "google_cloud_scheduler_job.job",
ImportState: true,
ImportStateVerify: true,
ImportStateVerifyIgnore: []string{"region"},
},
},
})
}

func testAccCloudSchedulerJob_schedulerJobHttpExample(context map[string]interface{}) string {
return Nprintf(`
resource "google_cloud_scheduler_job" "job" {
provider = "google-beta"
name = "test-job-%{random_suffix}"
description = "test http job"
schedule = "*/8 * * * *"
Expand All @@ -105,11 +106,6 @@ resource "google_cloud_scheduler_job" "job" {
uri = "https://example.com/ping"
}
}
provider "google-beta"{
region = "us-central1"
zone = "us-central1-a"
}
`, context)
}

Expand All @@ -122,21 +118,25 @@ func TestAccCloudSchedulerJob_schedulerJobAppEngineExample(t *testing.T) {

resource.Test(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t) },
Providers: testAccProvidersOiCS,
Providers: testAccProviders,
CheckDestroy: testAccCheckCloudSchedulerJobDestroy,
Steps: []resource.TestStep{
{
Config: testAccCloudSchedulerJob_schedulerJobAppEngineExample(context),
},
{
ResourceName: "google_cloud_scheduler_job.job",
ImportState: true,
ImportStateVerify: true,
ImportStateVerifyIgnore: []string{"region"},
},
},
})
}

func testAccCloudSchedulerJob_schedulerJobAppEngineExample(context map[string]interface{}) string {
return Nprintf(`
resource "google_cloud_scheduler_job" "job" {
provider = "google-beta"
name = "test-job-%{random_suffix}"
schedule = "*/4 * * * *"
description = "test app engine job"
Expand All @@ -154,11 +154,6 @@ resource "google_cloud_scheduler_job" "job" {
relative_uri = "/ping"
}
}
provider "google-beta"{
region = "us-central1"
zone = "us-central1-a"
}
`, context)
}

Expand Down
106 changes: 4 additions & 102 deletions google-beta/resource_compute_autoscaler_generated_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,106 +24,6 @@ import (
"github.com/hashicorp/terraform/terraform"
)

func TestAccComputeAutoscaler_autoscalerBetaExample(t *testing.T) {
t.Parallel()

context := map[string]interface{}{
"random_suffix": acctest.RandString(10),
}

resource.Test(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t) },
Providers: testAccProvidersOiCS,
CheckDestroy: testAccCheckComputeAutoscalerDestroy,
Steps: []resource.TestStep{
{
Config: testAccComputeAutoscaler_autoscalerBetaExample(context),
},
},
})
}

func testAccComputeAutoscaler_autoscalerBetaExample(context map[string]interface{}) string {
return Nprintf(`
resource "google_compute_autoscaler" "foobar" {
provider = "google-beta"
name = "my-autoscaler-%{random_suffix}"
zone = "us-central1-f"
target = "${google_compute_instance_group_manager.foobar.self_link}"
autoscaling_policy {
max_replicas = 5
min_replicas = 1
cooldown_period = 60
cpu_utilization {
target = 0.5
}
}
}
resource "google_compute_instance_template" "foobar" {
provider = "google-beta"
name = "my-instance-template-%{random_suffix}"
machine_type = "n1-standard-1"
can_ip_forward = false
tags = ["foo", "bar"]
disk {
source_image = "${data.google_compute_image.debian_9.self_link}"
}
network_interface {
network = "default"
}
metadata = {
foo = "bar"
}
service_account {
scopes = ["userinfo-email", "compute-ro", "storage-ro"]
}
}
resource "google_compute_target_pool" "foobar" {
provider = "google-beta"
name = "my-target-pool-%{random_suffix}"
}
resource "google_compute_instance_group_manager" "foobar" {
provider = "google-beta"
name = "my-igm-%{random_suffix}"
zone = "us-central1-f"
version {
instance_template = "${google_compute_instance_template.foobar.self_link}"
name = "primary"
}
target_pools = ["${google_compute_target_pool.foobar.self_link}"]
base_instance_name = "foobar"
}
data "google_compute_image" "debian_9" {
provider = "google-beta"
family = "debian-9"
project = "debian-cloud"
}
provider "google-beta"{
region = "us-central1"
zone = "us-central1-a"
}
`, context)
}

func TestAccComputeAutoscaler_autoscalerBasicExample(t *testing.T) {
t.Parallel()

Expand Down Expand Up @@ -198,8 +98,10 @@ resource "google_compute_instance_group_manager" "foobar" {
name = "my-igm-%{random_suffix}"
zone = "us-central1-f"
instance_template = "${google_compute_instance_template.foobar.self_link}"
version {
instance_template = "${google_compute_instance_template.foobar.self_link}"
name = "primary"
}
target_pools = ["${google_compute_target_pool.foobar.self_link}"]
base_instance_name = "foobar"
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,21 +33,24 @@ func TestAccComputeManagedSslCertificate_managedSslCertificateBasicExample(t *te

resource.Test(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t) },
Providers: testAccProvidersOiCS,
Providers: testAccProviders,
CheckDestroy: testAccCheckComputeManagedSslCertificateDestroy,
Steps: []resource.TestStep{
{
Config: testAccComputeManagedSslCertificate_managedSslCertificateBasicExample(context),
},
{
ResourceName: "google_compute_managed_ssl_certificate.default",
ImportState: true,
ImportStateVerify: true,
},
},
})
}

func testAccComputeManagedSslCertificate_managedSslCertificateBasicExample(context map[string]interface{}) string {
return Nprintf(`
resource "google_compute_managed_ssl_certificate" "default" {
provider = "google-beta"
name = "test-cert-%{random_suffix}"
managed {
Expand All @@ -56,16 +59,12 @@ resource "google_compute_managed_ssl_certificate" "default" {
}
resource "google_compute_target_https_proxy" "default" {
provider = "google-beta"
name = "test-proxy-%{random_suffix}"
url_map = "${google_compute_url_map.default.self_link}"
ssl_certificates = ["${google_compute_managed_ssl_certificate.default.self_link}"]
}
resource "google_compute_url_map" "default" {
provider = "google-beta"
name = "url-map-%{random_suffix}"
description = "a description"
Expand All @@ -88,8 +87,6 @@ resource "google_compute_url_map" "default" {
}
resource "google_compute_backend_service" "default" {
provider = "google-beta"
name = "backend-service-%{random_suffix}"
port_name = "http"
protocol = "HTTP"
Expand All @@ -99,43 +96,30 @@ resource "google_compute_backend_service" "default" {
}
resource "google_compute_http_health_check" "default" {
provider = "google-beta"
name = "http-health-check-%{random_suffix}"
request_path = "/"
check_interval_sec = 1
timeout_sec = 1
}
resource "google_dns_managed_zone" "zone" {
provider = "google-beta"
name = "dnszone-%{random_suffix}"
dns_name = "sslcert.tf-test.club."
}
resource "google_compute_global_forwarding_rule" "default" {
provider = "google-beta"
name = "forwarding-rule-%{random_suffix}"
target = "${google_compute_target_https_proxy.default.self_link}"
port_range = 443
}
resource "google_dns_record_set" "set" {
provider = "google-beta"
name = "sslcert.tf-test.club."
type = "A"
ttl = 3600
managed_zone = "${google_dns_managed_zone.zone.name}"
rrdatas = ["${google_compute_global_forwarding_rule.default.ip_address}"]
}
provider "google-beta"{
region = "us-central1"
zone = "us-central1-a"
}
`, context)
}

Expand Down
Loading

0 comments on commit ce1b1f4

Please sign in to comment.