Skip to content

Commit 97f8ffa

Browse files
Added google_compute_network_peering_routes_config to example so users pick up the right thing to do (#9892) (#6916)
[upstream:0767aacd3f074addbf06a59df80aa919e4062da8] Signed-off-by: Modular Magician <[email protected]>
1 parent 1ba8734 commit 97f8ffa

File tree

3 files changed

+42
-7
lines changed

3 files changed

+42
-7
lines changed

.changelog/9892.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
```release-note:none
2+
3+
```

google-beta/services/netapp/resource_netapp_storage_pool_generated_test.go

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,12 +57,13 @@ func TestAccNetappstoragePool_storagePoolCreateExample(t *testing.T) {
5757

5858
func testAccNetappstoragePool_storagePoolCreateExample(context map[string]interface{}) string {
5959
return acctest.Nprintf(`
60-
60+
# Create a network or use datasource to reference existing network
6161
resource "google_compute_network" "peering_network" {
6262
name = "tf-test-test-network%{random_suffix}"
6363
}
6464
65-
# Create an IP address
65+
# Reserve a CIDR for NetApp Volumes to use
66+
# When using shared-VPCs, this resource needs to be created in host project
6667
resource "google_compute_global_address" "private_ip_alloc" {
6768
name = "tf-test-test-address%{random_suffix}"
6869
purpose = "VPC_PEERING"
@@ -71,15 +72,29 @@ resource "google_compute_global_address" "private_ip_alloc" {
7172
network = google_compute_network.peering_network.id
7273
}
7374
74-
# Create a private connection
75+
# Create a Private Service Access connection
76+
# When using shared-VPCs, this resource needs to be created in host project
7577
resource "google_service_networking_connection" "default" {
7678
network = google_compute_network.peering_network.id
7779
service = "netapp.servicenetworking.goog"
7880
reserved_peering_ranges = [google_compute_global_address.private_ip_alloc.name]
7981
}
8082
83+
# Modify the PSA Connection to allow import/export of custom routes
84+
# When using shared-VPCs, this resource needs to be created in host project
85+
resource "google_compute_network_peering_routes_config" "route_updates" {
86+
peering = google_service_networking_connection.default.peering
87+
network = google_compute_network.peering_network.name
88+
89+
import_custom_routes = true
90+
export_custom_routes = true
91+
}
92+
93+
# Create a storage pool
94+
# Create this resource in the project which is expected to own the volumes
8195
resource "google_netapp_storage_pool" "test_pool" {
8296
name = "tf-test-test-pool%{random_suffix}"
97+
# project = <your_project>
8398
location = "us-central1"
8499
service_level = "PREMIUM"
85100
capacity_gib = "2048"

website/docs/r/netapp_storage_pool.html.markdown

Lines changed: 21 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,9 @@ Storage pools act as containers for volumes. All volumes in a storage pool share
2727
* LDAP use for NFS volumes, if applicable
2828
* Customer-managed encryption key (CMEK) policy
2929

30-
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.
30+
The capacity of the pool can be split up and assigned to volumes within the pool. Storage pools are a billable
31+
component of NetApp Volumes. Billing is based on the location, service level, and capacity allocated to a pool
32+
independent of consumption at the volume level.
3133

3234

3335
To get more information about storagePool, see:
@@ -45,12 +47,13 @@ To get more information about storagePool, see:
4547

4648

4749
```hcl
48-
50+
# Create a network or use datasource to reference existing network
4951
resource "google_compute_network" "peering_network" {
5052
name = "test-network"
5153
}
5254
53-
# Create an IP address
55+
# Reserve a CIDR for NetApp Volumes to use
56+
# When using shared-VPCs, this resource needs to be created in host project
5457
resource "google_compute_global_address" "private_ip_alloc" {
5558
name = "test-address"
5659
purpose = "VPC_PEERING"
@@ -59,15 +62,29 @@ resource "google_compute_global_address" "private_ip_alloc" {
5962
network = google_compute_network.peering_network.id
6063
}
6164
62-
# Create a private connection
65+
# Create a Private Service Access connection
66+
# When using shared-VPCs, this resource needs to be created in host project
6367
resource "google_service_networking_connection" "default" {
6468
network = google_compute_network.peering_network.id
6569
service = "netapp.servicenetworking.goog"
6670
reserved_peering_ranges = [google_compute_global_address.private_ip_alloc.name]
6771
}
6872
73+
# Modify the PSA Connection to allow import/export of custom routes
74+
# When using shared-VPCs, this resource needs to be created in host project
75+
resource "google_compute_network_peering_routes_config" "route_updates" {
76+
peering = google_service_networking_connection.default.peering
77+
network = google_compute_network.peering_network.name
78+
79+
import_custom_routes = true
80+
export_custom_routes = true
81+
}
82+
83+
# Create a storage pool
84+
# Create this resource in the project which is expected to own the volumes
6985
resource "google_netapp_storage_pool" "test_pool" {
7086
name = "test-pool"
87+
# project = <your_project>
7188
location = "us-central1"
7289
service_level = "PREMIUM"
7390
capacity_gib = "2048"

0 commit comments

Comments
 (0)