Skip to content

Latest commit

 

History

History
79 lines (61 loc) · 2.03 KB

README.md

File metadata and controls

79 lines (61 loc) · 2.03 KB

Nomad for Terraform

This module deploys an entire Nomad/Consul cluster, with minimal configuration.

The module can deploy both masters and slaves, in one call, or can be used to deploy them separately.

The module also includes support for AWS Elastic Container Registry (ECR), and will automatically get credentials for the slave nodes.

Example:

module "nomad" {
  source = "[email protected]:patch-notes/terraform-nomad.git"
  num_masters = 1
  num_slaves = 1
  availability_zones = ["eu-central-1a", "eu-central-1b"]
  master_instance_type = "t2.micro"
  cidr_vpc = "10.0.0.0/16"
  cidr_masters = "10.0.0.0/24"
  cidrs_slaves = ["10.0.1.0/24", "10.0.2.0/24"]
  key_name = "main"
  slave_target_group_arns = ["${aws_lb_target_group.gateway.arn}"]
  slave_instance_type = "t2.micro"
}

Parameters

cidr_vpc

The range for the masters' and slaves' VPC. default = "192.168.0.0/16"

vpc_name

This will be the name of the VPC, the subnets will be called ${vpc_name}-masters and ${vpc_name-slaves}. default = "nomad"

cidr_masters

The IP range for the masters' subnet. default = "192.168.0.0/24"

cidrs_slaves

The ranges for the slaves' subnets. default = ["192.168.1.0/24", "192.168.2.0/24"]

num_masters

The number of master nodes default = 3

num_slaves

The number of slave nodes default = 1

availability_zones

The availability zones where masters and slaves will be deployed.

key_name

The name of the SSH key to deploy to masters and slaves.

master_instance_type

The instance type for the masters default = "m4.large

slave_instance_type

The instance type for the slaves default = "m4.large

slave_instance_name

The instance name for slaves default = "nomad-slave"

master_instance_name

The instance name for slaves default = "nomad-master"

slave_target_group_arns

The ARNs of the Target Group to which the slaves are attached, to use with an Application Load Balancer (ALB). default = []

slave_security_groups

The ids of extra security groups to add the slaves to. default = []