@@ -402,6 +402,98 @@ resource "google_compute_subnetwork" "psc_ilb_nat" {
402402 ip_cidr_range = "10.1.0.0/16"
403403}
404404```
405+ <div class = " oics-button " style =" float : right ; margin : 0 0 -15px " >
406+ <a href =" https://console.cloud.google.com/cloudshell/open?cloudshell_git_repo=https%3A%2F%2Fgithub.com%2Fterraform-google-modules%2Fdocs-examples.git&cloudshell_image=gcr.io%2Fcloudshell-images%2Fcloudshell%3Alatest&cloudshell_print=.%2Fmotd&cloudshell_tutorial=.%2Ftutorial.md&cloudshell_working_dir=service_attachment_tunneling_config&open_in_editor=main.tf " target =" _blank " >
407+ <img alt="Open in Cloud Shell" src="//gstatic.com/cloudssh/images/open-btn.svg" style="max-height: 44px; margin: 32px auto; max-width: 100%;">
408+ </a >
409+ </div >
410+ ## Example Usage - Service Attachment Tunneling Config
411+
412+
413+ ``` hcl
414+ provider "google-beta" {
415+ }
416+
417+ resource "google_compute_service_attachment" "psc_ilb_service_attachment" {
418+ provider = google-beta
419+
420+ name = "my-psc-ilb"
421+ region = "us-west2"
422+ description = "A service attachment configured with tunneling"
423+
424+ enable_proxy_protocol = false
425+ connection_preference = "ACCEPT_AUTOMATIC"
426+ nat_subnets = [google_compute_subnetwork.psc_ilb_nat.id]
427+ target_service = google_compute_forwarding_rule.psc_ilb_target_service.id
428+
429+ tunneling_config {
430+ routing_mode = "REGIONAL"
431+ encapsulation_profile = "IPV4"
432+ }
433+ }
434+
435+ resource "google_compute_forwarding_rule" "psc_ilb_target_service" {
436+ provider = google-beta
437+
438+ name = "producer-forwarding-rule"
439+ region = "us-west2"
440+
441+ load_balancing_scheme = "INTERNAL"
442+ backend_service = google_compute_region_backend_service.producer_service_backend.id
443+ all_ports = true
444+ network = google_compute_network.psc_ilb_network.name
445+ subnetwork = google_compute_subnetwork.psc_ilb_producer_subnetwork.name
446+ }
447+
448+ resource "google_compute_region_backend_service" "producer_service_backend" {
449+ provider = google-beta
450+
451+ name = "producer-service"
452+ region = "us-west2"
453+
454+ health_checks = [google_compute_health_check.producer_service_health_check.id]
455+ }
456+
457+ resource "google_compute_health_check" "producer_service_health_check" {
458+ provider = google-beta
459+
460+ name = "producer-service-health-check"
461+
462+ check_interval_sec = 1
463+ timeout_sec = 1
464+ tcp_health_check {
465+ port = "80"
466+ }
467+ }
468+
469+ resource "google_compute_network" "psc_ilb_network" {
470+ provider = google-beta
471+
472+ name = "psc-ilb-network"
473+ auto_create_subnetworks = false
474+ }
475+
476+ resource "google_compute_subnetwork" "psc_ilb_producer_subnetwork" {
477+ provider = google-beta
478+
479+ name = "psc-ilb-producer-subnetwork"
480+ region = "us-west2"
481+
482+ network = google_compute_network.psc_ilb_network.id
483+ ip_cidr_range = "10.0.0.0/16"
484+ }
485+
486+ resource "google_compute_subnetwork" "psc_ilb_nat" {
487+ provider = google-beta
488+
489+ name = "psc-ilb-nat"
490+ region = "us-west2"
491+
492+ network = google_compute_network.psc_ilb_network.id
493+ purpose = "PRIVATE_SERVICE_CONNECT"
494+ ip_cidr_range = "10.1.0.0/16"
495+ }
496+ ```
405497<div class = " oics-button " style =" float : right ; margin : 0 0 -15px " >
406498 <a href =" https://console.cloud.google.com/cloudshell/open?cloudshell_git_repo=https%3A%2F%2Fgithub.com%2Fterraform-google-modules%2Fdocs-examples.git&cloudshell_image=gcr.io%2Fcloudshell-images%2Fcloudshell%3Alatest&cloudshell_print=.%2Fmotd&cloudshell_tutorial=.%2Ftutorial.md&cloudshell_working_dir=service_attachment_cross_region_ilb&open_in_editor=main.tf " target =" _blank " >
407499 <img alt="Open in Cloud Shell" src="//gstatic.com/cloudssh/images/open-btn.svg" style="max-height: 44px; margin: 32px auto; max-width: 100%;">
@@ -535,6 +627,11 @@ The following arguments are supported:
535627 valid domain name: "p.mycompany.com.". Current max number of domain names
536628 supported is 1.
537629
630+ * ` tunneling_config ` -
631+ (Optional, [ Beta] ( https://terraform.io/docs/providers/google/guides/provider_versions.html ) )
632+ Tunneling configuration for this service attachment.
633+ Structure is [ documented below] ( #nested_tunneling_config ) .
634+
538635* ` consumer_reject_lists ` -
539636 (Optional)
540637 An array of projects that are not allowed to connect to this service
@@ -574,6 +671,16 @@ Defaults to false.
574671
575672
576673
674+ <a name =" nested_tunneling_config " ></a >The ` tunneling_config ` block supports:
675+
676+ * ` routing_mode ` -
677+ (Optional)
678+ The routing mode for tunneling traffic.
679+
680+ * ` encapsulation_profile ` -
681+ (Optional)
682+ The encapsulation profile for tunneling traffic.
683+
577684<a name =" nested_consumer_accept_lists " ></a >The ` consumer_accept_lists ` block supports:
578685
579686* ` project_id_or_num ` -
@@ -601,13 +708,27 @@ In addition to the arguments listed above, the following computed attributes are
601708 Fingerprint of this resource. This field is used internally during
602709 updates of this resource.
603710
711+ * ` psc_service_attachment_id ` -
712+ An 128-bit global unique ID of the PSC service attachment.
713+ Structure is [ documented below] ( #nested_psc_service_attachment_id ) .
714+
604715* ` connected_endpoints ` -
605716 An array of the consumer forwarding rules connected to this service
606717 attachment.
607718 Structure is [ documented below] ( #nested_connected_endpoints ) .
608719* ` self_link ` - The URI of the created resource.
609720
610721
722+ <a name =" nested_psc_service_attachment_id " ></a >The ` psc_service_attachment_id ` block contains:
723+
724+ * ` high ` -
725+ (Output)
726+ The high 64 bits of the PSC service attachment ID.
727+
728+ * ` low ` -
729+ (Output)
730+ The low 64 bits of the PSC service attachment ID.
731+
611732<a name =" nested_connected_endpoints " ></a >The ` connected_endpoints ` block contains:
612733
613734* ` endpoint ` -
0 commit comments