Browse the Repo

file-type-icon.circleci
file-type-icon_docs
file-type-iconexamples
file-type-iconmodules
file-type-iconchronograf-security-group-rules
file-type-iconchronograf-server
file-type-iconinfluxdb-cluster
file-type-iconinfluxdb-commons
file-type-iconinfluxdb-iam-policies
file-type-iconinfluxdb-security-group-rules
file-type-iconinstall-chronograf
file-type-iconinstall-influxdb
file-type-iconinstall-kapacitor
file-type-iconinstall-telegraf
file-type-iconkapacitor-security-group-rules
file-type-iconkapacitor-server
file-type-iconload-balancer-target-group
file-type-iconload-balancer
file-type-iconREADME.md
file-type-iconmain.tf
file-type-iconoutputs.tf
file-type-iconvariables.tf
file-type-iconrun-chronograf
file-type-iconrun-influxdb
file-type-iconrun-kapacitor
file-type-iconrun-telegraf
file-type-icontest
file-type-icon.gitignore
file-type-icon.pre-commit-config.yaml
file-type-iconCODEOWNERS
file-type-iconCONTRIBUTING.md
file-type-iconLICENSE
file-type-iconNOTICE
file-type-iconREADME.md
file-type-iconmain.tf
file-type-iconoutputs.tf
file-type-iconvariables.tf

Browse the Repo

file-type-icon.circleci
file-type-icon_docs
file-type-iconexamples
file-type-iconmodules
file-type-iconchronograf-security-group-rules
file-type-iconchronograf-server
file-type-iconinfluxdb-cluster
file-type-iconinfluxdb-commons
file-type-iconinfluxdb-iam-policies
file-type-iconinfluxdb-security-group-rules
file-type-iconinstall-chronograf
file-type-iconinstall-influxdb
file-type-iconinstall-kapacitor
file-type-iconinstall-telegraf
file-type-iconkapacitor-security-group-rules
file-type-iconkapacitor-server
file-type-iconload-balancer-target-group
file-type-iconload-balancer
file-type-iconREADME.md
file-type-iconmain.tf
file-type-iconoutputs.tf
file-type-iconvariables.tf
file-type-iconrun-chronograf
file-type-iconrun-influxdb
file-type-iconrun-kapacitor
file-type-iconrun-telegraf
file-type-icontest
file-type-icon.gitignore
file-type-icon.pre-commit-config.yaml
file-type-iconCODEOWNERS
file-type-iconCONTRIBUTING.md
file-type-iconLICENSE
file-type-iconNOTICE
file-type-iconREADME.md
file-type-iconmain.tf
file-type-iconoutputs.tf
file-type-iconvariables.tf
InfluxDB

InfluxDB

Deploy an InfluxDB cluster. Supports automatic bootstrapping and auto healing.

Code Preview

Preview the Code

mobile file icon

README.md

down

Load Balancer

This folder contains a Terraform module that can be used to deploy an Application Load Balancer (ALB) in front of your InfluxDB data nodes cluster to:

  1. Perform health checks on the servers in the cluster.
  2. Distribute traffic from the Influx CLI and programming libraries across InfluxDB Data nodes.

Note that this module solely deploys the Load Balancer, as you may want to share one load balancer across multiple applications. To deploy Target Groups, health checks, and routing rules, use the load-balancer-target-group module.

See the examples folder for fully working sample code.

How do you use this module?

This folder defines a Terraform module, which you can use in your code by adding a module configuration and setting its source parameter to URL of this folder:

module "load_balancer" {
  # TODO: replace <VERSION> with the latest version from the releases page: https://github.com/gruntwork-io/terraform-aws-influx/releases
  source = "github.com/gruntwork/terraform-aws-influx//modules/load-balancer?ref=<VERSION>"
  
  name       = "influxdb-load-balancer"
  vpc_id     = "vpc-abcd1234"
  subnet_ids = ["subnet-abcd1234", "subnet-efgh5678"]

  http_listener_ports = [8086]
  
  allow_inbound_from_cidr_blocks = ["0.0.0.0/0"]

  # ... See variables.tf for the other parameters you must define for this module
}

The above code will create a Load Balancer.

Note the following:

  • source: Use this parameter in the module to specify the URL of the load-balancer module. The double slash (//) is intentional and required. Terraform uses it to specify subfolders within a Git repo (see module sources). The ref parameter specifies a specific Git tag in this repo. That way, instead of using the latest version of this module from the master branch, which will change every time you run Terraform, you're using a fixed version of the repo.

  • http_listener_ports: Which ports the load balancer should listen on for HTTP requests.

  • https_listener_ports_and_certs: Whic ports the load balancer should listen on for HTTPS requests and which TLS certs to use with those ports.

  • allow_inbound_from_cidr_blocks: Use this variable to specify which IP address ranges can connect to the Load Balancer. You can also use allow_inbound_from_security_groups to allow specific security groups to connect.

How is the ALB configured?

The ALB in this module is configured as follows:

  1. Listeners: The Load Balancer will create a listener for each port specified in http_listener_ports.

  2. DNS: You can use the route53_records variable to create one more more DNS A Records in Route 53 that point to the Load Balancer. This allows you to use custom domain names to access the Load Balancer.

Questions? Ask away.

We're here to talk about our services, answer any questions, give advice, or just to chat.

Ready to hand off the Gruntwork?