Skip to content

Commit

Permalink
Added google_compute_network_peering_routes_config to example so user…
Browse files Browse the repository at this point in the history
…s pick up the right thing to do (#9892) (#6916)

[upstream:0767aacd3f074addbf06a59df80aa919e4062da8]

Signed-off-by: Modular Magician <[email protected]>
  • Loading branch information
modular-magician authored Jan 30, 2024
1 parent 1ba8734 commit 97f8ffa
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 7 deletions.
3 changes: 3 additions & 0 deletions .changelog/9892.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:none

```
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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 = <your_project>
location = "us-central1"
service_level = "PREMIUM"
capacity_gib = "2048"
Expand Down
25 changes: 21 additions & 4 deletions website/docs/r/netapp_storage_pool.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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"
Expand All @@ -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 = <your_project>
location = "us-central1"
service_level = "PREMIUM"
capacity_gib = "2048"
Expand Down

0 comments on commit 97f8ffa

Please sign in to comment.