Skip to content

Commit

Permalink
Promote PSC global access to GA (#8013)
Browse files Browse the repository at this point in the history
* Promote PSC global access to GA
  • Loading branch information
hao-nan-li authored May 30, 2023
1 parent ae4709e commit 8429598
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 27 deletions.
2 changes: 0 additions & 2 deletions mmv1/products/compute/ForwardingRule.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down Expand Up @@ -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
11 changes: 0 additions & 11 deletions mmv1/templates/terraform/examples/forwarding_rule_vpc_psc.tf.erb
Original file line number Diff line number Diff line change
@@ -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 = ""
Expand All @@ -13,21 +12,18 @@ 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"
network = google_compute_network.consumer_net.id
}

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
Expand All @@ -38,21 +34,18 @@ 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"
network = google_compute_network.producer_net.id
}

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"
Expand All @@ -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"
Expand All @@ -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"

Expand All @@ -86,15 +77,13 @@ 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"

health_checks = [google_compute_health_check.producer_service_health_check.id]
}

resource "google_compute_health_check" "producer_service_health_check" {
provider = google-beta
name = "<%= ctx[:vars]['producer_healthcheck_name'] %>"

check_interval_sec = 1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,7 @@ func TestAccComputeForwardingRule_serviceDirectoryRegistrations(t *testing.T) {
},
})
}
<% end -%>

func TestAccComputeForwardingRule_forwardingRuleVpcPscExampleUpdate(t *testing.T) {
t.Parallel()
Expand All @@ -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{
Expand All @@ -193,7 +194,6 @@ func TestAccComputeForwardingRule_forwardingRuleVpcPscExampleUpdate(t *testing.T
},
})
}
<% end -%>

func TestAccComputeForwardingRule_forwardingRuleRegionalSteeringExampleUpdate(t *testing.T) {
t.Parallel()
Expand Down Expand Up @@ -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 = ""
Expand All @@ -565,21 +565,18 @@ 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"
network = google_compute_network.consumer_net.id
}

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
Expand All @@ -590,21 +587,18 @@ 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"
network = google_compute_network.producer_net.id
}

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"
Expand All @@ -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"
Expand All @@ -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"

Expand All @@ -638,15 +630,13 @@ 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"

health_checks = [google_compute_health_check.producer_service_health_check.id]
}

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
Expand All @@ -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(`
Expand Down

0 comments on commit 8429598

Please sign in to comment.