MayaNAS Terraform
Terraform modules for deploying MayaNAS across GCP, AWS, and Azure. Use these for automated, repeatable deployments with CI/CD integration.
Module Locations
Section titled “Module Locations”| Cloud | Path | Description |
|---|---|---|
| GCP | gcp/mayanas/ | Direct Terraform module |
| GCP Marketplace | gcp/mayanas/marketplace-package/ | Marketplace-wrapped module |
| AWS | aws/mayanas/ | EC2 + S3 + EBS deployment |
| Azure | azure/mayanas/ | VM + Blob + Managed Disk deployment |
Quick Start
Section titled “Quick Start”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}Key Variables
Section titled “Key Variables”| Variable | Type | Default | Description |
|---|---|---|---|
project_id | string | — | GCP project ID |
cluster_name / goog_cm_deployment_name | string | — | Cluster name |
deployment_type | string | active-active | active-active, active-passive, or single |
machine_type | string | n2-standard-4 | GCE machine type |
zone | string | — | Primary zone |
storage_pool_size | string | 1T | Cloud storage size (100G–1000T) |
metadata_disk_size_gb | number | 50 | Metadata SSD size — 50 GB suits 1-10 TB pools (ZFS metadata is roughly 0.3-0.5% of pool size) |
metadata_disk_type | string | pd-ssd | Metadata disk type |
bucket_count | number | 1 | Number of GCS buckets (1–12) |
multi_zone | bool | false | Cross-zone metadata disk |
enable_tcp_2020 | bool | true | Open Web UI firewall |
shares | list(object) | [] | NFS/SMB shares to auto-create |
Share Configuration
Section titled “Share Configuration”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" }]Key Outputs
Section titled “Key Outputs”| Output | Description |
|---|---|
node1_external_ip | Public IP of node 1 |
node2_external_ip | Public IP of node 2 |
vip_address | Primary VIP for NFS mounts |
vip_address_2 | Secondary VIP (active-active only) |
mayanas_password | Auto-generated Web UI password |
ssh_command_node1 | Ready-to-use SSH command |
web_ui_url_node1 | Web UI URL |
share_mount_instructions | NFS/SMB mount commands |
Quick Start
Section titled “Quick Start”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}Key Variables
Section titled “Key Variables”| Variable | Type | Default | Description |
|---|---|---|---|
cluster_name | string | — | Cluster name |
deployment_type | string | active-active | Deployment type |
instance_type | string | m5.xlarge | EC2 instance type |
key_pair_name | string | — | SSH key pair |
storage_size_gb | number | 1000 | S3 storage capacity |
availability_zone | string | "" | Preferred AZ (auto if empty) |
use_spot_instance | bool | false | Use Spot instances |
use_iam_role | bool | true | IAM role vs access keys |
Key Outputs
Section titled “Key Outputs”| Output | Description |
|---|---|
primary_public_ip | Public IP of primary node |
vip_address | Virtual IP for NFS |
ssh_command_primary | SSH command |
web_ui_tunnel_primary | SSH tunnel command for Web UI |
s3_bucket_names | Created S3 bucket names |
Quick Start
Section titled “Quick Start”module "mayanas" { source = "./azure/mayanas"
cluster_name = "prod-nas" deployment_type = "active-active" vm_size = "Standard_D4s_v5" location = "eastus" storage_size_gb = 1000}Key Variables
Section titled “Key Variables”| Variable | Type | Default | Description |
|---|---|---|---|
cluster_name | string | — | Cluster name |
deployment_type | string | active-active | Deployment type |
vm_size | string | Standard_D4s_v5 | VM size |
location | string | — | Azure region |
storage_size_gb | number | 1000 | Blob storage capacity |
metadata_disk_size_gb | number | 50 | Metadata disk size — 50 GB suits 1-10 TB pools |
vip_mechanism | string | custom-route | VIP mechanism (custom-route or load-balancer) |
multi_zone | bool | false | Cross-zone deployment |
Key Outputs
Section titled “Key Outputs”| Output | Description |
|---|---|
public_ips | Public IPs of all nodes |
vip_address | Virtual IP for NFS |
ssh_command_node1 | SSH command |
storage_account_name | Azure Storage Account |
nfs_mount_commands | Mount instructions |
Common Workflow
Section titled “Common Workflow”# Initializeterraform init
# Planterraform plan -out=tfplan
# Applyterraform apply tfplan
# View outputsterraform output
# Destroyterraform destroy