Skip to content

MayaNAS Terraform

Terraform modules for deploying MayaNAS across GCP, AWS, and Azure. Use these for automated, repeatable deployments with CI/CD integration.

CloudPathDescription
GCPgcp/mayanas/Direct Terraform module
GCP Marketplacegcp/mayanas/marketplace-package/Marketplace-wrapped module
AWSaws/mayanas/EC2 + S3 + EBS deployment
Azureazure/mayanas/VM + Blob + Managed Disk deployment
module "mayanas" {
source = "./gcp/mayanas"
project_id = "my-project"
cluster_name = "prod-nas"
region = "us-central1"
zone = "us-central1-a"
deployment_type = "active-active" # or "active-passive", "single"
machine_type = "n2-standard-4"
storage_pool_size = "1T"
metadata_disk_size_gb = 50
}
VariableTypeDefaultDescription
project_idstringGCP project ID
cluster_name / goog_cm_deployment_namestringCluster name
deployment_typestringactive-activeactive-active, active-passive, or single
machine_typestringn2-standard-4GCE machine type
zonestringPrimary zone
storage_pool_sizestring1TCloud storage size (100G–1000T)
metadata_disk_size_gbnumber50Metadata SSD size — 50 GB suits 1-10 TB pools (ZFS metadata is roughly 0.3-0.5% of pool size)
metadata_disk_typestringpd-ssdMetadata disk type
bucket_countnumber1Number of GCS buckets (1–12)
multi_zoneboolfalseCross-zone metadata disk
enable_tcp_2020booltrueOpen Web UI firewall
shareslist(object)[]NFS/SMB shares to auto-create
shares = [
{
name = "data"
recordsize = "1024K"
export = "nfs" # "nfs", "nfs3", "smb", or "multi"
},
{
name = "shared"
recordsize = "512K"
export = "multi" # Both NFS and SMB
smb_profile = "posix"
smb_user = "smbuser"
smb_password = "secret"
}
]
OutputDescription
node1_external_ipPublic IP of node 1
node2_external_ipPublic IP of node 2
vip_addressPrimary VIP for NFS mounts
vip_address_2Secondary VIP (active-active only)
mayanas_passwordAuto-generated Web UI password
ssh_command_node1Ready-to-use SSH command
web_ui_url_node1Web UI URL
share_mount_instructionsNFS/SMB mount commands
module "mayanas" {
source = "./aws/mayanas"
cluster_name = "prod-nas"
deployment_type = "active-active"
instance_type = "m5.xlarge"
key_pair_name = "my-key"
storage_size_gb = 1000
}
VariableTypeDefaultDescription
cluster_namestringCluster name
deployment_typestringactive-activeDeployment type
instance_typestringm5.xlargeEC2 instance type
key_pair_namestringSSH key pair
storage_size_gbnumber1000S3 storage capacity
availability_zonestring""Preferred AZ (auto if empty)
use_spot_instanceboolfalseUse Spot instances
use_iam_rolebooltrueIAM role vs access keys
OutputDescription
primary_public_ipPublic IP of primary node
vip_addressVirtual IP for NFS
ssh_command_primarySSH command
web_ui_tunnel_primarySSH tunnel command for Web UI
s3_bucket_namesCreated S3 bucket names
module "mayanas" {
source = "./azure/mayanas"
cluster_name = "prod-nas"
deployment_type = "active-active"
vm_size = "Standard_D4s_v5"
location = "eastus"
storage_size_gb = 1000
}
VariableTypeDefaultDescription
cluster_namestringCluster name
deployment_typestringactive-activeDeployment type
vm_sizestringStandard_D4s_v5VM size
locationstringAzure region
storage_size_gbnumber1000Blob storage capacity
metadata_disk_size_gbnumber50Metadata disk size — 50 GB suits 1-10 TB pools
vip_mechanismstringcustom-routeVIP mechanism (custom-route or load-balancer)
multi_zoneboolfalseCross-zone deployment
OutputDescription
public_ipsPublic IPs of all nodes
vip_addressVirtual IP for NFS
ssh_command_node1SSH command
storage_account_nameAzure Storage Account
nfs_mount_commandsMount instructions
Terminal window
# Initialize
terraform init
# Plan
terraform plan -out=tfplan
# Apply
terraform apply tfplan
# View outputs
terraform output
# Destroy
terraform destroy