This Terraform module deploys Neo4j Enterprise on Google Cloud Platform (GCP). It supports both standalone and clustered deployments.
- Deploys Neo4j Enterprise on GCP using Ubuntu 22.04 LTS
- Supports standalone or clustered deployments (1, 3, 4, 5, 6, or 7 nodes)
- Uses individual VMs instead of Managed Instance Groups
- Configures networking, firewall rules, and persistent storage
- Optional Neo4j Bloom installation
- Uses SSD persistent disks (pd-ssd) for optimal performance
- Available on GCP Marketplace
- Fully compliant with GCP Marketplace requirements (uses only approved providers)
neo4j-terraform-gcp/
├── modules/ # Terraform modules
│ └── neo4j/ # Main Neo4j module
│ ├── scripts/ # Startup scripts for Neo4j
│ ├── main.tf # Main module configuration
│ ├── network.tf # Network configuration
│ ├── variables.tf # Module variables
│ ├── outputs.tf # Module outputs
│ └── versions.tf # Module provider requirements
├── test/ # Test configurations
├── metadata.yaml # GCP Marketplace metadata
├── metadata.display.yaml # GCP Marketplace display metadata
├── logo.png # Logo for GCP Marketplace
├── main.tf # Root module configuration
├── variables.tf # Root module variables
├── outputs.tf # Root module outputs
├── versions.tf # Provider and version constraints
└── terraform.tfvars.example # Example variables file
- Terraform 1.2.0 or newer
- Google Cloud SDK
- A GCP project with billing enabled
- Appropriate permissions to create resources in GCP
- Default project configured in gcloud CLI (
gcloud config set project YOUR_PROJECT_ID
)
- Visit the Neo4j Enterprise listing on GCP Marketplace
- Click "Launch"
- Configure the deployment parameters
- Review and Launch
- Ensure your default GCP project is set in gcloud CLI:
gcloud config set project YOUR_PROJECT_ID
- Copy
terraform.tfvars.example
toterraform.tfvars
and update the values - Initialize Terraform:
terraform init
- Plan the deployment:
terraform plan
- Apply the configuration:
terraform apply
The following variables can be configured in your terraform.tfvars
file:
Variable | Description | Default |
---|---|---|
project_id | GCP Project ID | (Required) |
region | GCP Region | us-central1 |
zone | GCP Zone | us-central1-a |
deployment_name | Deployment name | neo4j |
image | The VM image to use for Neo4j instances | projects/launcher-public/global/images/neo4j-enterprise-edition-byol-v20250305 |
node_count | Number of Neo4j nodes | 3 |
machine_type | GCP machine type | c3-standard-4 |
disk_size | Data disk size in GB | 100 |
disk_type | Type of disk to use | pd-ssd |
admin_password | Neo4j admin password | (Required) |
license_type | Neo4j license type (enterprise-byol or evaluation) | enterprise-byol |
firewall_source_range | Source IP ranges for firewall rules (comma-separated) | 0.0.0.0/0 |
For a complete list of inputs, see the variables.tf file.
Note for GCP Marketplace: When deploying through GCP Marketplace, the
image
variable will be automatically set to the Marketplace-owned version of the VM image.
Output | Description |
---|---|
neo4j_url | URL to access Neo4j Browser |
neo4j_bolt_url | Bolt URL for connecting to Neo4j |
neo4j_ip_addresses | IP addresses of the Neo4j nodes |
neo4j_instance_names | Names of the Neo4j instances |
neo4j_instance_zones | Zones where Neo4j instances are deployed |
neo4j_instance_machine_types | Machine types of Neo4j instances |
This module deploys:
- A VPC network and subnetwork (optional)
- Firewall rules for internal and external access
- Neo4j VMs with attached persistent disks
- Configures Neo4j for standalone or clustered operation
This module only uses the following approved GCP Marketplace providers:
- google-beta
The module includes test configurations in the test/
directory:
verify_module.sh
: Basic verification for GCP Marketplacetest_deployment.sh
: Comprehensive deployment testing using marketplace_test.tfvars
The test script performs thorough checks to verify:
- All instances are properly deployed
- Neo4j services are running and accessible
- Neo4j Browser and Bolt interfaces are operational
- Cluster configuration is properly set up
- For production deployments, it's recommended to restrict the
firewall_source_range
to specific IP ranges - The default machine type (c3-standard-4) is suitable for most workloads, but can be adjusted based on your requirements
- For large datasets, consider increasing the
disk_size
parameter - The startup script includes robust error handling and non-interactive installation to ensure reliable deployment
This module is licensed under the Apache License 2.0.