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-iconREADME.md
file-type-iconmain.tf
file-type-iconoutputs.tf
file-type-iconvariables.tf
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-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-iconREADME.md
file-type-iconmain.tf
file-type-iconoutputs.tf
file-type-iconvariables.tf
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-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

Chronograf Server

This folder contains a Terraform module to deploy a Chronograf server in AWS. The idea is to create an Amazon Machine Image (AMI) that has the Chronograf binary installed using the install-chronograf module.

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 "chronograf_server" {
  # TODO: replace <VERSION> with the latest version from the releases page: https://github.com/gruntwork-io/terraform-aws-influx/releases
  source = "github.com/gruntwork-io/terraform-aws-influx//modules/chronograf-server?ref=<VERSION>"

  # Specify the ID of the Chronograf AMI. You should build this using the scripts in the install-chronograf module.
  ami_id = "ami-abcd1234"
  
  # Configure and start Chronograf during boot. 
  user_data = <<-EOF
              #!/bin/bash
              sudo systemctl start chronograf
              EOF
  
  # ... See variables.tf for the other parameters you must define for the chronograf-server module
}

Note the following parameters:

  • source: Use this parameter to specify the URL of the chronograf-server 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.

  • ami_id: Use this parameter to specify the ID of an Chronograf Amazon Machine Image (AMI) to deploy on each server in the cluster. You should install Chronograf the scripts in the install-chronograf module.

  • user_data: Use this parameter to specify a User Data script that each server will run during boot. This is where you can use the run-chronograf script to configure and run Chronograf as either a meta node or a data node.

You can find the other parameters in variables.tf.

Check out the examples folder for fully-working sample code.

How do you connect to the Chronograf server?

Once deployed you can simply access the web UI by visiting the http://<public-ip>:<port>, you can get the public_ip by running:

$ terraform output public_ip

What's included in this module?

This module creates the following:

Security Group

The EC2 Instance has a Security Group that allows minimal connectivity:

  • All outbound requests
  • Inbound SSH access from the CIDR blocks and security groups you specify

The Security Group ID is exported as an output variable which you can use with the chronograf-security-group-rules module to open up all the ports necessary for Chronograf.

Dedicated instances

If you wish to use dedicated instances, you can set the tenancy parameter to "dedicated" in this module.

Encryption

This module does not currently support specifying encryption information. The official documentation contains a guide for enabling SSL.

Security groups

This module attaches a security group to the EC2 Instance that allows inbound requests as follows:

  • SSH: For the SSH port (default: 22), you can use the allowed_ssh_cidr_blocks parameter to control the list of
    CIDR blocks that will be allowed access. You can use the allowed_inbound_ssh_security_group_ids parameter to control the list of source Security Groups that will be allowed access.

The ID of the security group is exported as an output variable, which you can use with the chronograf-security-group-rules module to open up all the ports necessary for Chronograf.

SSH access

You can associate an EC2 Key Pair with the EC2 Instance by specifying the Key Pair's name in the ssh_key_name variable. If you don't want to associate a Key Pair with these servers, set ssh_key_name to an empty string.

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?