From d70dde3ca902411f71fee7f8daece579de8fcc87 Mon Sep 17 00:00:00 2001 From: The Magician Date: Tue, 30 Jan 2024 09:19:30 -0800 Subject: [PATCH] Added google_compute_network_peering_routes_config to example so users pick up the right thing to do (#9892) (#17140) [upstream:0767aacd3f074addbf06a59df80aa919e4062da8] Signed-off-by: Modular Magician --- .changelog/9892.txt | 3 +++ ...urce_netapp_storage_pool_generated_test.go | 21 +++++++++++++--- .../docs/r/netapp_storage_pool.html.markdown | 25 ++++++++++++++++--- 3 files changed, 42 insertions(+), 7 deletions(-) create mode 100644 .changelog/9892.txt diff --git a/.changelog/9892.txt b/.changelog/9892.txt new file mode 100644 index 00000000000..42b910df155 --- /dev/null +++ b/.changelog/9892.txt @@ -0,0 +1,3 @@ +```release-note:none + +``` \ No newline at end of file diff --git a/google/services/netapp/resource_netapp_storage_pool_generated_test.go b/google/services/netapp/resource_netapp_storage_pool_generated_test.go index 12faefc1e0e..d32e1a68c23 100644 --- a/google/services/netapp/resource_netapp_storage_pool_generated_test.go +++ b/google/services/netapp/resource_netapp_storage_pool_generated_test.go @@ -57,12 +57,13 @@ func TestAccNetappstoragePool_storagePoolCreateExample(t *testing.T) { func testAccNetappstoragePool_storagePoolCreateExample(context map[string]interface{}) string { return acctest.Nprintf(` - +# Create a network or use datasource to reference existing network resource "google_compute_network" "peering_network" { name = "tf-test-test-network%{random_suffix}" } -# Create an IP address +# Reserve a CIDR for NetApp Volumes to use +# When using shared-VPCs, this resource needs to be created in host project resource "google_compute_global_address" "private_ip_alloc" { name = "tf-test-test-address%{random_suffix}" purpose = "VPC_PEERING" @@ -71,15 +72,29 @@ resource "google_compute_global_address" "private_ip_alloc" { network = google_compute_network.peering_network.id } -# Create a private connection +# Create a Private Service Access connection +# When using shared-VPCs, this resource needs to be created in host project resource "google_service_networking_connection" "default" { network = google_compute_network.peering_network.id service = "netapp.servicenetworking.goog" reserved_peering_ranges = [google_compute_global_address.private_ip_alloc.name] } +# Modify the PSA Connection to allow import/export of custom routes +# When using shared-VPCs, this resource needs to be created in host project +resource "google_compute_network_peering_routes_config" "route_updates" { + peering = google_service_networking_connection.default.peering + network = google_compute_network.peering_network.name + + import_custom_routes = true + export_custom_routes = true +} + +# Create a storage pool +# Create this resource in the project which is expected to own the volumes resource "google_netapp_storage_pool" "test_pool" { name = "tf-test-test-pool%{random_suffix}" + # project = location = "us-central1" service_level = "PREMIUM" capacity_gib = "2048" diff --git a/website/docs/r/netapp_storage_pool.html.markdown b/website/docs/r/netapp_storage_pool.html.markdown index 7809d4c5278..236887eb871 100644 --- a/website/docs/r/netapp_storage_pool.html.markdown +++ b/website/docs/r/netapp_storage_pool.html.markdown @@ -27,7 +27,9 @@ Storage pools act as containers for volumes. All volumes in a storage pool share * LDAP use for NFS volumes, if applicable * Customer-managed encryption key (CMEK) policy -The capacity of the pool can be split up and assigned to volumes within the pool. Storage pools are a billable component of NetApp Volumes. Billing is based on the location, service level, and capacity allocated to a pool independent of consumption at the volume level. +The capacity of the pool can be split up and assigned to volumes within the pool. Storage pools are a billable +component of NetApp Volumes. Billing is based on the location, service level, and capacity allocated to a pool +independent of consumption at the volume level. To get more information about storagePool, see: @@ -45,12 +47,13 @@ To get more information about storagePool, see: ```hcl - +# Create a network or use datasource to reference existing network resource "google_compute_network" "peering_network" { name = "test-network" } -# Create an IP address +# Reserve a CIDR for NetApp Volumes to use +# When using shared-VPCs, this resource needs to be created in host project resource "google_compute_global_address" "private_ip_alloc" { name = "test-address" purpose = "VPC_PEERING" @@ -59,15 +62,29 @@ resource "google_compute_global_address" "private_ip_alloc" { network = google_compute_network.peering_network.id } -# Create a private connection +# Create a Private Service Access connection +# When using shared-VPCs, this resource needs to be created in host project resource "google_service_networking_connection" "default" { network = google_compute_network.peering_network.id service = "netapp.servicenetworking.goog" reserved_peering_ranges = [google_compute_global_address.private_ip_alloc.name] } +# Modify the PSA Connection to allow import/export of custom routes +# When using shared-VPCs, this resource needs to be created in host project +resource "google_compute_network_peering_routes_config" "route_updates" { + peering = google_service_networking_connection.default.peering + network = google_compute_network.peering_network.name + + import_custom_routes = true + export_custom_routes = true +} + +# Create a storage pool +# Create this resource in the project which is expected to own the volumes resource "google_netapp_storage_pool" "test_pool" { name = "test-pool" + # project = location = "us-central1" service_level = "PREMIUM" capacity_gib = "2048"