Skip to content

DeimosCloud/terraform-google-nfs

Repository files navigation

Terraform-google-NFS

A terraform module to setup NFS on a VM on GCP. This is not FileStore. Filestore minimum storage is 1TB which is $200 per month. For testing purposes, a smaller NFS setup is required. This compensates for that.

Usage

# NFS server VM to be used by apps such as magento
module "nfs" {
  source = "."

  name_prefix = "${var.project_name}-nfs-${var.environment}"
  labels      = local.common_labels
  subnetwork  = module.vpc.public_subnetwork
  project     = var.project_id
  network     = local.vpc_name
  export_paths = [
    "/share/media",
    "/share/static",
  ]
  capacity_gb = "100"
}

Contributing

Report issues/questions/feature requests on in the issues section.

Full contributing guidelines are covered here.

Requirements

No requirements.

Providers

Name Version
google n/a

Inputs

Name Description Type Default Required
attach_public_ip Whether to make the instance public or not bool false no
auto_delete_disk Whether or not the boot disk should be auto-deleted bool false no
capacity_gb File share capacity in GiB. string "50" no
disk_type (Optional) The GCE disk type. Can be either pd-ssd, local-ssd, pd-balanced or pd-standard string "pd-standard" no
export_paths Paths to exports list
[
"/share"
]
no
image_family n/a string "ubuntu-2004-lts" no
labels (Optional) Resource labels to represent user-provided metadata. map {} no
machine_type Machine type to create, e.g. n1-standard-1 string "f1-micro" no
metadata Metadata to be added to the compute instance, provided as a map map {} no
name_prefix The name prefix for the instance. string "nfs-instance-template" no
network Network to deploy to. Only one of network or subnetwork should be specified. any null no
network_tier IP Address Network Tier string "STANDARD" no
project (Optional) The ID of the project in which the resource belongs. If it is not provided, the provider project is used. any null no
region Region where the instances should be created. any null no
service_account Service account to attach to the instance. See https://www.terraform.io/docs/providers/google/r/compute_instance_template.html#service_account.
object({
email = string,
scopes = set(string)
})
{
"email": null,
"scopes": []
}
no
source_image_project n/a string "ubuntu-os-cloud" no
subnetwork Subnet to deploy to. Only one of network or subnetwork should be specified. any null no
tags Additional network tags to attach to the instance nfs instance list [] no
zone The Compute Instance Zone any null no

Outputs

Name Description
disk_size Size of disk used for NFS
internal_ip Instance Internal IP
public_ip Instance Public IP