Code Monkey home page Code Monkey logo

terraform-neo4j's Introduction

terraform-neo4j

Terraform module to setup all resources needed for setting up a Neo4j cluster (enterprise).

neo4j

Available variables

Name Description Type Default Required
ami String(optional, "ami-1b791862"): AMI to be used for the Neo4j nodes string "ami-1b791862" no
backup_enabled Int(optional, false): Whether to allow client connections for taking backups string "false" no
backup_port Int(optional, 6362): Backup client port string "6362" no
backup_sg_ids List(optional, []): Security group IDs for the backup client(s) list <list> no
bolt_enabled Int(optional, true): Whether to allow client connections via Bolt string "true" no
bolt_port Int(optional, 9000): Bolt client port string "9000" no
client_sg_ids List(optional, []): Security group IDs for client access to the cluster, via Bolt and/or HTTP(S) list <list> no
cloudwatch_logs_enabled Bool(optional, false): Whether to enable Cloudwatch Logs string "false" no
core_count Int(optional, 1): Size of the Core Neo4j cluster string "3" no
core_type String(optional, t2.small): Instance type to use for the Core instances string "t2.small" no
customer String(optional): Customer name string "" no
discovery_port Int(optional, 5000): Causal clustering discovery port string "5000" no
environment String(required): Environment name string n/a yes
http_enabled Int(optional, true): Whether to allow client connections via HTTP string "true" no
http_port Int(optional, 7474): HTTP client port string "7474" no
https_enabled Int(optional, false): Whether to allow client connections via HTTPS string "false" no
https_port Int(optional, 7473): HTTPS client port string "7473" no
key_name String(required): ID of the SSH key to use for the Neo4j nodes string n/a yes
name String(optional, "neo4j"): Name to use for the Neo4j cluster string "neo4j" no
project String(required): Project name string n/a yes
r53_domain String(optional, ""): R53 master name to use for setting neo4j DNS records. No records are created when not set string "" no
raft_port Int(optional, 7000): Causal clustering raft port string "7000" no
security_group_ids List(optional, []): Extra security group IDs to attach to the cluster. Note: a default SG is already created and exposed via outputs list <list> no
subnet_ids List(required): Subnet IDs where to deploy the cluster list <list> no
tags Map(optional, {}): Optional tags map <map> no
termination_protection Bool(optional, true): Whether to enable termination protection on the Ne04j nodes string "true" no
transaction_port Int(optional, 6000): Causal clustering transaction port string "6000" no
volume_encryption_enabled Bool(optional, false): Whether to enables EBS encryption string "false" no
volume_iops Int(required if volume_type="io1"): Amount of provisioned IOPS for the EBS volume string "0" no
volume_path String(optional, "/var/lib/neo4j/data"): Mount path of the EBS volume string "/var/lib/neo4j/data" no
volume_size Int(required): EBS volume size (in GB) to use string n/a yes
volume_type String(optional, "gp2"): EBS volume type to use string "gp2" no
vpc_id String(required): VPC ID where to deploy the cluster string n/a yes

Outputs

Name Description
instance_ids List: IDs of the EC2 instances
instance_private_dns List: The private DNS name assigned to the instance. Can only be used inside the Amazon EC2, and only available if you've enabled DNS hostnames for your VPC
instance_private_ips List: The private IP address assigned to the instances
instance_public_dns List: The public DNS name assigned to the instance. For EC2-VPC, this is only available if you've enabled DNS hostnames for your VPC
instance_public_ips List: The public IP address assigned to the instance, if applicable. NOTE: If you are using an aws_eip with your instance, you should refer to the EIP's address directly and not use public_ip, as this field will change after the EIP is attached.
instances_role_id IAM role ID used by the EC2 instances
instances_role_name IAM role name used by the EC2 instances
sg_id ID of the Neo4j security group

Example

Setting up a cluster

module "neo4j" {
  source             = "github.com/skyscrapers/terraform-neo4j?ref=0.1"
  project            = "${var.project}"
  environment        = "${terraform.workspace}"
  name               = "neo4j"
  key_name           = "key"
  volume_size        = 50
  vpc_id             = "${module.vpc.vpc_id}"
  subnet_ids         = "${module.vpc.private_db_subnets}"
  security_group_ids = ["${module.sg_all.sg_id}"]
  client_sg_ids      = ["${data.aws_security_group.kubernetes.id}"]
  backup_enabled     = true
  backup_sg_ids      = ["${data.terraform_remote_state.static.jumphost_sg_id}"]
  r53_domain         = "foo.bar"
}

Backups

When using Neo4j enterprise edition, it's possible to take (and restore) online backups via the neo4j-admin tool. Controlling backup access is done by setting the following variables:

  • [backup_sg_ids]
  • [backup_enabled]
  • [backup_port]

Logging

terraform-neo4j's People

Contributors

duboisph avatar leonyork avatar iuriaranda avatar

Stargazers

Steve avatar Athi Fongoqa avatar arun9theja avatar Anil avatar  avatar Jonathan Cardoso avatar Vik avatar Kinnaird McQuade avatar Michael Bushey avatar

Watchers

Sam Clinckspoor avatar  avatar James Cloos avatar Mattias Gees avatar Luca Venturelli avatar  avatar

terraform-neo4j's Issues

Error downloading modules

$ terraform init

Initializing modules...
- module.neo4j
  Getting source "github.com/skyscrapers/terraform-neo4j?ref=0.1"
Error downloading modules: Error loading modules: error downloading 'https://github.com/skyscrapers/terraform-neo4j.git?ref=0.1': /usr/bin/git exited with 1: error: pathspec '0.1' did not match any file(s) known to git.

Any ideas?

'aws_instance.instance_no_ebs' does not have attribute 'network_interface_id'

I'm getting the following:

Error: Error applying plan:

1 error(s) occurred:

* module.neo4j.module.core.output.instance_network_interface_ids: Resource 'aws_instance.instance_no_ebs' does not have attribute 'network_interface_id' for variable 'aws_instance.instance_no_ebs.*.network_interface_id'

when using the plan:

variable "region" {
  default = "us-east-1"
}
variable "stage" {
  default = "dev"
}
variable "service" {
  default = "graph-db-api"
}
variable "neo4j_core_count" {
  default = 3
}
variable "neo4j_core_type" {
  default = "t2.micro"
}
variable "neo4j_volume_size" {
  default = 20
}

provider "aws" {
  region = "${var.region}"
}

resource "aws_vpc" "vpc" {
  cidr_block = "10.0.0.0/16"
}

resource "aws_subnet" "subnet" {
  vpc_id     = "${aws_vpc.vpc.id}"
  cidr_block = "10.0.1.0/24"
}

module "ssh_key_pair" {
  source                = "github.com/cloudposse/terraform-aws-key-pair?ref=master"
  namespace             = "${var.service}"
  stage                 = "${var.stage}"
  name                  = "${var.service}"
  ssh_public_key_path   = "./secrets"
  generate_ssh_key      = "true"
}
module "neo4j" {
  source             = "github.com/leonyork/terraform-neo4j?ref=master"
  project            = "${var.service}"
  environment        = "${terraform.workspace}"
  name               = "${var.service}"
  key_name           = "${module.ssh_key_pair.key_name}"
  volume_size        = "${var.neo4j_volume_size}"
  vpc_id             = "${aws_vpc.vpc.id}"
  core_type          = "${var.neo4j_core_type}"
  subnet_ids         = ["${aws_subnet.subnet.id}"]
  backup_enabled     = false
  ami                = "ami-0de53d8956e8dcf80"
}

terraform --version

Terraform v0.11.7
+ provider.aws v2.8.0
+ provider.local v1.2.2
+ provider.null v2.1.2
+ provider.template v2.1.2
+ provider.tls v2.0.1

You need to update the refs for the module sources in main.tf.

Will submit a PR

How to get instance ids?

Hello,

I have your module working great due to your previous help, thank you. :) I would like to be able to get the instance ID's in other terraform code. It seems like I should be able to add a block like this to outputs.tf:

output "instance_ids" {
  value = [ "${aws_instance.instance_no_ebs.*.id}" ]
}

and then in my code use something like instance = "${module.neo4j.instance_ids.2}"
Is this the correct way to do this or is there a better way?

Thanks!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.