This module makes it easy to setup NetApp Volumes. It is designed to deploy Stroage Pool and Storage Volume(s). Creation of Storage Pool is optional. Module can create Storage Volme(s) in an existing storage pool.
This module is meant for use with Terraform 1.3+ and tested using Terraform 1.3+. If you find incompatibilities using Terraform >=1.3, please open an issue.
Current version is 0.X. Upgrade guides:
Functional examples are included in the examples directory. Basic usage of this module is as follows:
- Create a Storage Pool and Storage Volumes
module "netapp_pool_volume" {
source = "GoogleCloudPlatform/netapp-volumes/google"
version = "~> 1.0"
project_id = "test-project-id"
location = "us-central1"
storage_pool = {
create_pool = true
name = "test-pool"
size = "2048"
service_level = "PREMIUM"
ldap_enabled = false
network_name = "test-network"
labels = {
pool_env = "test"
}
description = "test pool"
}
storage_volumes = [
{
name = "test-volume-1"
share_name = "test-volume-1"
size = "100"
protocols = ["NFSV3"]
snapshot_policy = {
enabled = true
daily_schedule = {
snapshots_to_keep = 1
minute = 45
hour = 23
}
}
export_policy_rules = {
test = {
allowed_clients = "10.0.0.0/24,10.100.0.0/24"
access_type = "READ_WRITE"
nfsv3 = true
has_root_access = true
}
}
},
{
name = "test-volume-2"
share_name = "test-volume-2"
size = "200"
protocols = ["NFSV3"]
snapshot_policy = {
enabled = true
daily_schedule = {
snapshots_to_keep = 1
hour = 22
}
}
},
]
}
- Create storage volumes in an existing storage pool
module "storage_pool_only" {
source = "GoogleCloudPlatform/netapp-volumes/google"
version = "~> 1.0"
project_id = var.project_id
location = var.region
storage_pool = {
create_pool = true
name = "test-pool-2"
size = "2048"
service_level = "PREMIUM"
ldap_enabled = false
network_name = var.network_name
labels = {
pool_env = "test"
}
description = "test storage pool only"
}
depends_on = [
google_service_networking_connection.vpc_connection,
google_service_networking_connection.netapp_vpc_connection,
]
}
## 3 - Create storage volume in the storage pool already created
module "volumes_only" {
source = "GoogleCloudPlatform/netapp-volumes/google"
version = "~> 1.0"
project_id = module.netapp_volumes.storage_pool.project
location = module.netapp_volumes.storage_pool.location
# name of an existing storage pool
storage_pool = {
create_pool = false
name = module.storage_pool_only.storage_pool.name
}
storage_volumes = [
# test-volume-3
{
name = "test-volume-3"
share_name = "test-volume-3"
size = "100"
protocols = ["NFSV3"]
deletion_policy = "FORCE"
snapshot_policy = {
enabled = true
daily_schedule = {
snapshots_to_keep = 1
minute = 21
hour = 4
}
weekly_schedule = {
snapshots_to_keep = 2
minute = 1
hour = 3
day = "Sunday"
}
}
export_policy_rules = {
test = {
allowed_clients = "10.0.0.0/24,10.100.0.0/24"
access_type = "READ_WRITE"
nfsv3 = true
has_root_access = true
}
}
},
]
depends_on = [
module.netapp_volumes,
]
}
Name | Description | Type | Default | Required |
---|---|---|---|---|
common_labels | Common Labels as key value pairs. Applies to all the resources. If labels are provided in storege_pool or storage_volumes then they are merged with common labels before being applied to the resources | map(any) |
{} |
no |
location | Name of the location. Usually a region name, expect for some STANDARD service level pools which require a zone name | string |
n/a | yes |
project_id | The ID of the project in which the resource belongs | string |
n/a | yes |
storage_pool | Storage pool details | object({ |
n/a | yes |
storage_volumes | List of Storage Volumes | list(object({ |
[] |
no |
Name | Description |
---|---|
storage_pool | Storage Pool created |
storage_volumes | Storage Volume(s) created |
In order to create Storage Pool set create_pool
to true
, provide values for name
, network_name
, service_level
and size
. Other fields are optional.
If you already have a Storage Pool created, set create_pool
to false
and provide name
of an existing Storage Pool.
Provide list of storage volumes to create. Each volume requires name
, size
, share_name
and protocols. Other fields are optional.
These sections describe requirements for using this module.
The following dependencies must be available:
- [Terraform][terraform] v1.3+
- [Terraform Provider for GCP][terraform-provider-gcp] plugin v5.33+
A service account with the following roles must be used to provision the resources of this module:
- Google Cloud NetApp Volumes Admin:
roles/netapp.admin
A project with the following APIs enabled must be used to host the resources of this module:
- Google Cloud NetApp Volumes API:
netapp.googleapis.com
The Project Factory module can be used to provision a project with the necessary APIs enabled.
Refer to the contribution guidelines for information on contributing to this module.
Please see our security disclosure process.