From a4a9cdb2f46b04529813c9dbdab5f94495862766 Mon Sep 17 00:00:00 2001 From: hao-nan-li <100219545+hao-nan-li@users.noreply.github.com> Date: Tue, 30 May 2023 08:23:37 -0700 Subject: [PATCH] Promote PSC global access to GA (#8013) * Promote PSC global access to GA --- mmv1/products/compute/ForwardingRule.yaml | 2 -- .../examples/forwarding_rule_vpc_psc.tf.erb | 11 ----------- ...resource_compute_forwarding_rule_test.go.erb | 17 +++-------------- 3 files changed, 3 insertions(+), 27 deletions(-) diff --git a/mmv1/products/compute/ForwardingRule.yaml b/mmv1/products/compute/ForwardingRule.yaml index c70701be2be2..1564567b8d43 100644 --- a/mmv1/products/compute/ForwardingRule.yaml +++ b/mmv1/products/compute/ForwardingRule.yaml @@ -162,7 +162,6 @@ examples: - 'ip_address' - !ruby/object:Provider::Terraform::Examples name: 'forwarding_rule_vpc_psc' - min_version: 'beta' primary_resource_id: 'default' vars: forwarding_rule_name: 'psc-endpoint' @@ -588,5 +587,4 @@ properties: description: This is used in PSC consumer ForwardingRule to control whether the PSC endpoint can be accessed from another region. - min_version: beta send_empty_value: true diff --git a/mmv1/templates/terraform/examples/forwarding_rule_vpc_psc.tf.erb b/mmv1/templates/terraform/examples/forwarding_rule_vpc_psc.tf.erb index 65b15d614f31..c6561ddbd4b0 100644 --- a/mmv1/templates/terraform/examples/forwarding_rule_vpc_psc.tf.erb +++ b/mmv1/templates/terraform/examples/forwarding_rule_vpc_psc.tf.erb @@ -1,6 +1,5 @@ // Forwarding rule for VPC private service connect resource "google_compute_forwarding_rule" "<%= ctx[:primary_resource_id] %>" { - provider = google-beta name = "<%= ctx[:vars]['forwarding_rule_name'] %>" region = "us-central1" load_balancing_scheme = "" @@ -13,13 +12,11 @@ resource "google_compute_forwarding_rule" "<%= ctx[:primary_resource_id] %>" { // Consumer service endpoint resource "google_compute_network" "consumer_net" { - provider = google-beta name = "<%= ctx[:vars]['consumer_network_name'] %>" auto_create_subnetworks = false } resource "google_compute_subnetwork" "consumer_subnet" { - provider = google-beta name = "<%= ctx[:vars]['consumer_network_name'] %>" ip_cidr_range = "10.0.0.0/16" region = "us-central1" @@ -27,7 +24,6 @@ resource "google_compute_subnetwork" "consumer_subnet" { } resource "google_compute_address" "consumer_address" { - provider = google-beta name = "<%= ctx[:vars]['ip_name'] %>-1" region = "us-central1" subnetwork = google_compute_subnetwork.consumer_subnet.id @@ -38,13 +34,11 @@ resource "google_compute_address" "consumer_address" { // Producer service attachment resource "google_compute_network" "producer_net" { - provider = google-beta name = "<%= ctx[:vars]['producer_network_name'] %>" auto_create_subnetworks = false } resource "google_compute_subnetwork" "producer_subnet" { - provider = google-beta name = "<%= ctx[:vars]['producer_network_name'] %>" ip_cidr_range = "10.0.0.0/16" region = "us-central1" @@ -52,7 +46,6 @@ resource "google_compute_subnetwork" "producer_subnet" { } resource "google_compute_subnetwork" "psc_producer_subnet" { - provider = google-beta name = "<%= ctx[:vars]['producer_psc_network_name'] %>" ip_cidr_range = "10.1.0.0/16" region = "us-central1" @@ -62,7 +55,6 @@ resource "google_compute_subnetwork" "psc_producer_subnet" { } resource "google_compute_service_attachment" "producer_service_attachment" { - provider = google-beta name = "<%= ctx[:vars]['service_attachment_name'] %>" region = "us-central1" description = "A service attachment configured with Terraform" @@ -74,7 +66,6 @@ resource "google_compute_service_attachment" "producer_service_attachment" { } resource "google_compute_forwarding_rule" "producer_target_service" { - provider = google-beta name = "<%= ctx[:vars]['producer_forwarding_rule_name'] %>" region = "us-central1" @@ -86,7 +77,6 @@ resource "google_compute_forwarding_rule" "producer_target_service" { } resource "google_compute_region_backend_service" "producer_service_backend" { - provider = google-beta name = "<%= ctx[:vars]['producer_backend_name'] %>" region = "us-central1" @@ -94,7 +84,6 @@ resource "google_compute_region_backend_service" "producer_service_backend" { } resource "google_compute_health_check" "producer_service_health_check" { - provider = google-beta name = "<%= ctx[:vars]['producer_healthcheck_name'] %>" check_interval_sec = 1 diff --git a/mmv1/third_party/terraform/tests/resource_compute_forwarding_rule_test.go.erb b/mmv1/third_party/terraform/tests/resource_compute_forwarding_rule_test.go.erb index 15d0490e6b17..c940610be671 100644 --- a/mmv1/third_party/terraform/tests/resource_compute_forwarding_rule_test.go.erb +++ b/mmv1/third_party/terraform/tests/resource_compute_forwarding_rule_test.go.erb @@ -161,6 +161,7 @@ func TestAccComputeForwardingRule_serviceDirectoryRegistrations(t *testing.T) { }, }) } +<% end -%> func TestAccComputeForwardingRule_forwardingRuleVpcPscExampleUpdate(t *testing.T) { t.Parallel() @@ -171,7 +172,7 @@ func TestAccComputeForwardingRule_forwardingRuleVpcPscExampleUpdate(t *testing.T VcrTest(t, resource.TestCase{ PreCheck: func() { AccTestPreCheck(t) }, - ProtoV5ProviderFactories: ProtoV5ProviderBetaFactories(t), + ProtoV5ProviderFactories: ProtoV5ProviderFactories(t), CheckDestroy: testAccCheckComputeForwardingRuleDestroyProducer(t), Steps: []resource.TestStep{ resource.TestStep{ @@ -193,7 +194,6 @@ func TestAccComputeForwardingRule_forwardingRuleVpcPscExampleUpdate(t *testing.T }, }) } -<% end -%> func TestAccComputeForwardingRule_forwardingRuleRegionalSteeringExampleUpdate(t *testing.T) { t.Parallel() @@ -547,12 +547,12 @@ resource "google_service_directory_service" "examplesvc" { } `, poolName, ruleName, svcDirNamespace, serviceName) } +<% end -%> func testAccComputeForwardingRule_forwardingRuleVpcPscExampleUpdate(context map[string]interface{}) string { return Nprintf(` // Forwarding rule for VPC private service connect resource "google_compute_forwarding_rule" "default" { - provider = google-beta name = "tf-test-psc-endpoint%{random_suffix}" region = "us-central1" load_balancing_scheme = "" @@ -565,13 +565,11 @@ resource "google_compute_forwarding_rule" "default" { // Consumer service endpoint resource "google_compute_network" "consumer_net" { - provider = google-beta name = "tf-test-consumer-net%{random_suffix}" auto_create_subnetworks = false } resource "google_compute_subnetwork" "consumer_subnet" { - provider = google-beta name = "tf-test-consumer-net%{random_suffix}" ip_cidr_range = "10.0.0.0/16" region = "us-central1" @@ -579,7 +577,6 @@ resource "google_compute_subnetwork" "consumer_subnet" { } resource "google_compute_address" "consumer_address" { - provider = google-beta name = "tf-test-website-ip%{random_suffix}-1" region = "us-central1" subnetwork = google_compute_subnetwork.consumer_subnet.id @@ -590,13 +587,11 @@ resource "google_compute_address" "consumer_address" { // Producer service attachment resource "google_compute_network" "producer_net" { - provider = google-beta name = "tf-test-producer-net%{random_suffix}" auto_create_subnetworks = false } resource "google_compute_subnetwork" "producer_subnet" { - provider = google-beta name = "tf-test-producer-net%{random_suffix}" ip_cidr_range = "10.0.0.0/16" region = "us-central1" @@ -604,7 +599,6 @@ resource "google_compute_subnetwork" "producer_subnet" { } resource "google_compute_subnetwork" "psc_producer_subnet" { - provider = google-beta name = "tf-test-producer-psc-net%{random_suffix}" ip_cidr_range = "10.1.0.0/16" region = "us-central1" @@ -614,7 +608,6 @@ resource "google_compute_subnetwork" "psc_producer_subnet" { } resource "google_compute_service_attachment" "producer_service_attachment" { - provider = google-beta name = "tf-test-producer-service%{random_suffix}" region = "us-central1" description = "A service attachment configured with Terraform" @@ -626,7 +619,6 @@ resource "google_compute_service_attachment" "producer_service_attachment" { } resource "google_compute_forwarding_rule" "producer_target_service" { - provider = google-beta name = "tf-test-producer-forwarding-rule%{random_suffix}" region = "us-central1" @@ -638,7 +630,6 @@ resource "google_compute_forwarding_rule" "producer_target_service" { } resource "google_compute_region_backend_service" "producer_service_backend" { - provider = google-beta name = "tf-test-producer-service-backend%{random_suffix}" region = "us-central1" @@ -646,7 +637,6 @@ resource "google_compute_region_backend_service" "producer_service_backend" { } resource "google_compute_health_check" "producer_service_health_check" { - provider = google-beta name = "tf-test-producer-service-health-check%{random_suffix}" check_interval_sec = 1 @@ -657,7 +647,6 @@ resource "google_compute_health_check" "producer_service_health_check" { } `, context) } -<% end -%> func testAccComputeForwardingRule_forwardingRuleRegionalSteeringExampleUpdate(context map[string]interface{}) string { return Nprintf(`