Storage pools act as containers for volumes. All volumes in a storage pool share the following information:
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:
# Create a network or use datasource to reference existing network
resource "google_compute_network" "peering_network" {
name = "test-network"
}
# 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"
address_type = "INTERNAL"
prefix_length = 16
network = google_compute_network.peering_network.id
}
# 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"
network = google_compute_network.peering_network.id
}
The following arguments are supported:
service_level
-
(Required)
Service level of the storage pool.
Possible values are: PREMIUM
, EXTREME
, STANDARD
.
capacity_gib
-
(Required)
Capacity of the storage pool (in GiB).
network
-
(Required)
VPC network name with format: projects/{{project}}/global/networks/{{network}}
location
-
(Required)
Name of the location. Usually a region name, expect for some STANDARD service level pools which require a zone name.
name
-
(Required)
The resource name of the storage pool. Needs to be unique per location.
description
-
(Optional)
An optional description of this resource.
labels
-
(Optional)
Labels as key value pairs. Example: { "owner": "Bob", "department": "finance", "purpose": "testing" }
.
Note: This field is non-authoritative, and will only manage the labels present in your configuration.
Please refer to the field effective_labels
for all of the labels present on the resource.
active_directory
-
(Optional)
Specifies the Active Directory policy to be used. Format: projects/{{project}}/locations/{{location}}/activeDirectories/{{name}}
.
The policy needs to be in the same location as the storage pool.
kms_config
-
(Optional)
Specifies the CMEK policy to be used for volume encryption. Format: projects/{{project}}/locations/{{location}}/kmsConfigs/{{name}}
.
The policy needs to be in the same location as the storage pool.
ldap_enabled
-
(Optional)
When enabled, the volumes uses Active Directory as LDAP name service for UID/GID lookups. Required to enable extended group support for NFSv3,
using security identifiers for NFSv4.1 or principal names for kerberized NFSv4.1.
project
- (Optional) The ID of the project in which the resource belongs.
If it is not provided, the provider project is used.
In addition to the arguments listed above, the following computed attributes are exported:
id
- an identifier for the resource with format projects/{{project}}/locations/{{location}}/storagePools/{{name}}
volume_capacity_gib
-
Size allocated to volumes in the storage pool (in GiB).
volume_count
-
Number of volume in the storage pool.
encryption_type
-
Reports if volumes in the pool are encrypted using a Google-managed encryption key or CMEK.
terraform_labels
-
The combination of labels configured directly on the resource
and default labels configured on the provider.
effective_labels
-
All of labels (key/value pairs) present on the resource in GCP, including the labels configured through Terraform, other clients and services.
This resource provides the following Timeouts configuration options:
create
- Default is 20 minutes.update
- Default is 20 minutes.delete
- Default is 20 minutes.storagePool can be imported using any of these accepted formats:
projects/{{project}}/locations/{{location}}/storagePools/{{name}}
{{project}}/{{location}}/{{name}}
{{location}}/{{name}}
In Terraform v1.5.0 and later, use an import
block to import storagePool using one of the formats above. For example:
import {
id = "projects/{{project}}/locations/{{location}}/storagePools/{{name}}"
to = google_netapp_storage_pool.default
}
When using the terraform import
command, storagePool can be imported using one of the formats above. For example:
$ terraform import google_netapp_storage_pool.default projects/{{project}}/locations/{{location}}/storagePools/{{name}}
$ terraform import google_netapp_storage_pool.default {{project}}/{{location}}/{{name}}
$ terraform import google_netapp_storage_pool.default {{location}}/{{name}}
This resource supports User Project Overrides.