blob: 236887eb871cdaa91e3418d00f250bf5f7075ace [file] [log] [blame]
---
# ----------------------------------------------------------------------------
#
# *** AUTO GENERATED CODE *** Type: MMv1 ***
#
# ----------------------------------------------------------------------------
#
# This file is automatically generated by Magic Modules and manual
# changes will be clobbered when the file is regenerated.
#
# Please read more about how to change this file in
# .github/CONTRIBUTING.md.
#
# ----------------------------------------------------------------------------
subcategory: "Google Cloud NetApp Volumes"
description: |-
Storage pools act as containers for volumes.
---
# google\_netapp\_storage\_pool
Storage pools act as containers for volumes. All volumes in a storage pool share the following information:
* Location
* Service level
* Virtual Private Cloud (VPC) network
* Active Directory policy
* 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.
To get more information about storagePool, see:
* [API documentation](https://cloud.google.com/netapp/volumes/docs/reference/rest/v1/projects.locations.storagePools)
* How-to Guides
* [QUICKSTART_TITLE](https://cloud.google.com/netapp/volumes/docs/get-started/quickstarts/create-storage-pool)
<div class = "oics-button" style="float: right; margin: 0 0 -15px">
<a href="https://console.cloud.google.com/cloudshell/open?cloudshell_git_repo=https%3A%2F%2Fgithub.com%2Fterraform-google-modules%2Fdocs-examples.git&cloudshell_working_dir=Storage_pool_create&cloudshell_image=gcr.io%2Fcloudshell-images%2Fcloudshell%3Alatest&open_in_editor=main.tf&cloudshell_print=.%2Fmotd&cloudshell_tutorial=.%2Ftutorial.md" target="_blank">
<img alt="Open in Cloud Shell" src="//gstatic.com/cloudssh/images/open-btn.svg" style="max-height: 44px; margin: 32px auto; max-width: 100%;">
</a>
</div>
## Example Usage - Storage Pool Create
```hcl
# 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
}
```
## Argument Reference
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.
## Attributes Reference
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.
## Timeouts
This resource provides the following
[Timeouts](https://developer.hashicorp.com/terraform/plugin/sdkv2/resources/retries-and-customizable-timeouts) configuration options:
- `create` - Default is 20 minutes.
- `update` - Default is 20 minutes.
- `delete` - Default is 20 minutes.
## Import
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](https://developer.hashicorp.com/terraform/language/import) to import storagePool using one of the formats above. For example:
```tf
import {
id = "projects/{{project}}/locations/{{location}}/storagePools/{{name}}"
to = google_netapp_storage_pool.default
}
```
When using the [`terraform import` command](https://developer.hashicorp.com/terraform/cli/commands/import), 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}}
```
## User Project Overrides
This resource supports [User Project Overrides](https://registry.terraform.io/providers/hashicorp/google/latest/docs/guides/provider_reference#user_project_override).