Skip to content

Commit

Permalink
Promote region* compute services to GA (#3381) (#2017)
Browse files Browse the repository at this point in the history
Signed-off-by: Modular Magician <[email protected]>
  • Loading branch information
modular-magician authored and emilymye committed Apr 29, 2020
1 parent c5e2716 commit cbac6da
Show file tree
Hide file tree
Showing 14 changed files with 120 additions and 188 deletions.
15 changes: 15 additions & 0 deletions .changelog/3381.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
```release-note:new-resource
`google_compute_region_url_map` is now GA
```
```release-note:new-resource
`google_compute_region_target_http_proxy` is now GA
```
```release-note:new-resource
`google_compute_region_target_https_proxy` is now GA
```
```release-note:enhancement
compute: Promoted the following `google_compute_backend_service` fields to GA: `circuit_breakers`, `consistent_hash`, `custom_request_headers`, `locality_lb_policy`, `outlier_detection`
```
```release-note:enhancement
compute: Promoted the following `google_compute_region_backend_service` fields to GA: `affinity_cookie_ttl_sec`,`circuit_breakers`, `consistent_hash`, `failover_policy`, `locality_lb_policy`, `outlier_detection`, `log_config`, `failover`
```
Original file line number Diff line number Diff line change
Expand Up @@ -78,21 +78,24 @@ func TestAccComputeRegionBackendService_regionBackendServiceIlbRoundRobinExample

vcrTest(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t) },
Providers: testAccProvidersOiCS,
Providers: testAccProviders,
CheckDestroy: testAccCheckComputeRegionBackendServiceDestroyProducer(t),
Steps: []resource.TestStep{
{
Config: testAccComputeRegionBackendService_regionBackendServiceIlbRoundRobinExample(context),
},
{
ResourceName: "google_compute_region_backend_service.default",
ImportState: true,
ImportStateVerify: true,
},
},
})
}

func testAccComputeRegionBackendService_regionBackendServiceIlbRoundRobinExample(context map[string]interface{}) string {
return Nprintf(`
resource "google_compute_region_backend_service" "default" {
provider = "google-beta"
region = "us-central1"
name = "tf-test-region-service%{random_suffix}"
health_checks = ["${google_compute_health_check.health_check.self_link}"]
Expand All @@ -102,8 +105,6 @@ resource "google_compute_region_backend_service" "default" {
}
resource "google_compute_health_check" "health_check" {
provider = "google-beta"
name = "tf-test-rbs-health-check%{random_suffix}"
http_health_check {
port = 80
Expand All @@ -121,21 +122,24 @@ func TestAccComputeRegionBackendService_regionBackendServiceIlbRingHashExample(t

vcrTest(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t) },
Providers: testAccProvidersOiCS,
Providers: testAccProviders,
CheckDestroy: testAccCheckComputeRegionBackendServiceDestroyProducer(t),
Steps: []resource.TestStep{
{
Config: testAccComputeRegionBackendService_regionBackendServiceIlbRingHashExample(context),
},
{
ResourceName: "google_compute_region_backend_service.default",
ImportState: true,
ImportStateVerify: true,
},
},
})
}

func testAccComputeRegionBackendService_regionBackendServiceIlbRingHashExample(context map[string]interface{}) string {
return Nprintf(`
resource "google_compute_region_backend_service" "default" {
provider = "google-beta"
region = "us-central1"
name = "tf-test-region-service%{random_suffix}"
health_checks = ["${google_compute_health_check.health_check.self_link}"]
Expand All @@ -161,8 +165,6 @@ resource "google_compute_region_backend_service" "default" {
}
resource "google_compute_health_check" "health_check" {
provider = "google-beta"
name = "tf-test-rbs-health-check%{random_suffix}"
http_health_check {
port = 80
Expand All @@ -180,21 +182,24 @@ func TestAccComputeRegionBackendService_regionBackendServiceBalancingModeExample

vcrTest(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t) },
Providers: testAccProvidersOiCS,
Providers: testAccProviders,
CheckDestroy: testAccCheckComputeRegionBackendServiceDestroyProducer(t),
Steps: []resource.TestStep{
{
Config: testAccComputeRegionBackendService_regionBackendServiceBalancingModeExample(context),
},
{
ResourceName: "google_compute_region_backend_service.default",
ImportState: true,
ImportStateVerify: true,
},
},
})
}

func testAccComputeRegionBackendService_regionBackendServiceBalancingModeExample(context map[string]interface{}) string {
return Nprintf(`
resource "google_compute_region_backend_service" "default" {
provider = google-beta
load_balancing_scheme = "INTERNAL_MANAGED"
backend {
Expand All @@ -212,15 +217,11 @@ resource "google_compute_region_backend_service" "default" {
}
data "google_compute_image" "debian_image" {
provider = google-beta
family = "debian-9"
project = "debian-cloud"
}
resource "google_compute_region_instance_group_manager" "rigm" {
provider = google-beta
region = "us-central1"
name = "tf-test-rbs-rigm%{random_suffix}"
version {
Expand All @@ -232,8 +233,6 @@ resource "google_compute_region_instance_group_manager" "rigm" {
}
resource "google_compute_instance_template" "instance_template" {
provider = google-beta
name = "template-tf-test-region-service%{random_suffix}"
machine_type = "n1-standard-1"
Expand All @@ -252,8 +251,6 @@ resource "google_compute_instance_template" "instance_template" {
}
resource "google_compute_region_health_check" "default" {
provider = google-beta
region = "us-central1"
name = "tf-test-rbs-health-check%{random_suffix}"
http_health_check {
Expand All @@ -262,16 +259,12 @@ resource "google_compute_region_health_check" "default" {
}
resource "google_compute_network" "default" {
provider = google-beta
name = "tf-test-rbs-net%{random_suffix}"
auto_create_subnetworks = false
routing_mode = "REGIONAL"
}
resource "google_compute_subnetwork" "default" {
provider = google-beta
name = "tf-test-rbs-net%{random_suffix}-default"
ip_cidr_range = "10.1.2.0/24"
region = "us-central1"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -128,12 +128,18 @@ func TestAccComputeRegionSslCertificate_regionSslCertificateTargetHttpsProxiesEx

vcrTest(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t) },
Providers: testAccProvidersOiCS,
Providers: testAccProviders,
CheckDestroy: testAccCheckComputeRegionSslCertificateDestroyProducer(t),
Steps: []resource.TestStep{
{
Config: testAccComputeRegionSslCertificate_regionSslCertificateTargetHttpsProxiesExample(context),
},
{
ResourceName: "google_compute_region_ssl_certificate.default",
ImportState: true,
ImportStateVerify: true,
ImportStateVerifyIgnore: []string{"private_key", "name_prefix"},
},
},
})
}
Expand All @@ -151,7 +157,6 @@ func testAccComputeRegionSslCertificate_regionSslCertificateTargetHttpsProxiesEx
// name with name_prefix, or use random_id resource. Example:
resource "google_compute_region_ssl_certificate" "default" {
provider = google-beta
region = "us-central1"
name_prefix = "my-certificate-"
private_key = file("test-fixtures/ssl_cert/test.key")
Expand All @@ -163,15 +168,13 @@ resource "google_compute_region_ssl_certificate" "default" {
}
resource "google_compute_region_target_https_proxy" "default" {
provider = google-beta
region = "us-central1"
name = "tf-test-test-proxy%{random_suffix}"
url_map = google_compute_region_url_map.default.self_link
ssl_certificates = [google_compute_region_ssl_certificate.default.self_link]
}
resource "google_compute_region_url_map" "default" {
provider = google-beta
region = "us-central1"
name = "tf-test-url-map%{random_suffix}"
description = "a description"
Expand All @@ -195,7 +198,6 @@ resource "google_compute_region_url_map" "default" {
}
resource "google_compute_region_backend_service" "default" {
provider = google-beta
region = "us-central1"
name = "tf-test-backend-service%{random_suffix}"
protocol = "HTTP"
Expand All @@ -205,7 +207,6 @@ resource "google_compute_region_backend_service" "default" {
}
resource "google_compute_region_health_check" "default" {
provider = google-beta
region = "us-central1"
name = "tf-test-http-health-check%{random_suffix}"
http_health_check {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,29 +32,30 @@ func TestAccComputeRegionTargetHttpProxy_regionTargetHttpProxyBasicExample(t *te

vcrTest(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t) },
Providers: testAccProvidersOiCS,
Providers: testAccProviders,
CheckDestroy: testAccCheckComputeRegionTargetHttpProxyDestroyProducer(t),
Steps: []resource.TestStep{
{
Config: testAccComputeRegionTargetHttpProxy_regionTargetHttpProxyBasicExample(context),
},
{
ResourceName: "google_compute_region_target_http_proxy.default",
ImportState: true,
ImportStateVerify: true,
},
},
})
}

func testAccComputeRegionTargetHttpProxy_regionTargetHttpProxyBasicExample(context map[string]interface{}) string {
return Nprintf(`
resource "google_compute_region_target_http_proxy" "default" {
provider = google-beta
region = "us-central1"
name = "tf-test-test-proxy%{random_suffix}"
url_map = google_compute_region_url_map.default.self_link
}
resource "google_compute_region_url_map" "default" {
provider = google-beta
region = "us-central1"
name = "tf-test-url-map%{random_suffix}"
default_service = google_compute_region_backend_service.default.self_link
Expand All @@ -76,8 +77,6 @@ resource "google_compute_region_url_map" "default" {
}
resource "google_compute_region_backend_service" "default" {
provider = google-beta
region = "us-central1"
name = "tf-test-backend-service%{random_suffix}"
protocol = "HTTP"
Expand All @@ -87,8 +86,6 @@ resource "google_compute_region_backend_service" "default" {
}
resource "google_compute_region_health_check" "default" {
provider = google-beta
region = "us-central1"
name = "tf-test-http-health-check%{random_suffix}"
http_health_check {
Expand All @@ -107,29 +104,30 @@ func TestAccComputeRegionTargetHttpProxy_regionTargetHttpProxyHttpsRedirectExamp

vcrTest(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t) },
Providers: testAccProvidersOiCS,
Providers: testAccProviders,
CheckDestroy: testAccCheckComputeRegionTargetHttpProxyDestroyProducer(t),
Steps: []resource.TestStep{
{
Config: testAccComputeRegionTargetHttpProxy_regionTargetHttpProxyHttpsRedirectExample(context),
},
{
ResourceName: "google_compute_region_target_http_proxy.default",
ImportState: true,
ImportStateVerify: true,
},
},
})
}

func testAccComputeRegionTargetHttpProxy_regionTargetHttpProxyHttpsRedirectExample(context map[string]interface{}) string {
return Nprintf(`
resource "google_compute_region_target_http_proxy" "default" {
provider = google-beta
region = "us-central1"
name = "tf-test-test-https-redirect-proxy%{random_suffix}"
url_map = google_compute_region_url_map.default.self_link
}
resource "google_compute_region_url_map" "default" {
provider = google-beta
region = "us-central1"
name = "tf-test-url-map%{random_suffix}"
default_url_redirect {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,39 +32,38 @@ func TestAccComputeRegionTargetHttpsProxy_regionTargetHttpsProxyBasicExample(t *

vcrTest(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t) },
Providers: testAccProvidersOiCS,
Providers: testAccProviders,
CheckDestroy: testAccCheckComputeRegionTargetHttpsProxyDestroyProducer(t),
Steps: []resource.TestStep{
{
Config: testAccComputeRegionTargetHttpsProxy_regionTargetHttpsProxyBasicExample(context),
},
{
ResourceName: "google_compute_region_target_https_proxy.default",
ImportState: true,
ImportStateVerify: true,
},
},
})
}

func testAccComputeRegionTargetHttpsProxy_regionTargetHttpsProxyBasicExample(context map[string]interface{}) string {
return Nprintf(`
resource "google_compute_region_target_https_proxy" "default" {
provider = google-beta
region = "us-central1"
name = "tf-test-test-proxy%{random_suffix}"
url_map = google_compute_region_url_map.default.self_link
ssl_certificates = [google_compute_region_ssl_certificate.default.self_link]
}
resource "google_compute_region_ssl_certificate" "default" {
provider = google-beta
region = "us-central1"
name = "tf-test-my-certificate%{random_suffix}"
private_key = file("test-fixtures/ssl_cert/test.key")
certificate = file("test-fixtures/ssl_cert/test.crt")
}
resource "google_compute_region_url_map" "default" {
provider = google-beta
region = "us-central1"
name = "tf-test-url-map%{random_suffix}"
description = "a description"
Expand All @@ -88,8 +87,6 @@ resource "google_compute_region_url_map" "default" {
}
resource "google_compute_region_backend_service" "default" {
provider = google-beta
region = "us-central1"
name = "tf-test-backend-service%{random_suffix}"
protocol = "HTTP"
Expand All @@ -99,8 +96,6 @@ resource "google_compute_region_backend_service" "default" {
}
resource "google_compute_region_health_check" "default" {
provider = google-beta
region = "us-central1"
name = "tf-test-http-health-check%{random_suffix}"
http_health_check {
Expand Down
Loading

0 comments on commit cbac6da

Please sign in to comment.