Browse the Repo

file-type-icon.circleci
file-type-icon_docs
file-type-iconexamples
file-type-iconchronograf-ami
file-type-iconinfluxdb-ami
file-type-iconinfluxdb-cluster-simple
file-type-iconkapacitor-ami
file-type-iconconfig
file-type-iconREADME.md
file-type-iconkapacitor.json
file-type-iconlocal-mocks
file-type-icontelegraf-ami
file-type-icontick-ami
file-type-icontick-multi-cluster
file-type-icontick-single-cluster
file-type-iconmodules
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-iconchronograf-ami
file-type-iconinfluxdb-ami
file-type-iconinfluxdb-cluster-simple
file-type-iconkapacitor-ami
file-type-iconconfig
file-type-iconREADME.md
file-type-iconkapacitor.json
file-type-iconlocal-mocks
file-type-icontelegraf-ami
file-type-icontick-ami
file-type-icontick-multi-cluster
file-type-icontick-single-cluster
file-type-iconmodules
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

Kapacitor AMI

This folder shows an example of how to use the install-kapacitor modules with Packer to create Amazon Machine Images (AMIs) that have Kapacitor, and its dependencies installed on top of:

  1. Ubuntu 18.04
  2. Amazon Linux 2

Kapacitor is usually installed as a collection agent on your application's EC2 instance(s). This Kapacitor AMI is only useful for starting up Kapacitor to pull remote data or accept data from a remote service, e.g. connecting to a queue like Kafka/PubSub or using it as a scraper to pull prometheus metrics.

Quick start

To build the Kapacitor AMI:

  1. git clone this repo to your computer.
  2. Install Packer.
  3. Configure your AWS credentials using one of the options supported by the AWS SDK. Usually, the easiest option is to set the AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY environment variables.
  4. Update the variables section of the kapacitor.json Packer template to specify the AWS region and Kapacitor version you wish to use.
  5. To build an Ubuntu AMI for Kapacitor: packer build -only=kapacitor-ami-ubuntu kapacitor.json.
  6. To build an Amazon Linux AMI for Kapacitor: packer build -only=kapacitor-ami-amazon-linux kapacitor.json.

Creating your own Packer template for production usage

When creating your own Packer template for production usage, you can copy the example in this folder more or less exactly, except for one change: we recommend replacing the file provisioner with a call to git clone in a shell provisioner. Instead of:

{
  "provisioners": [{
    "type": "file",
    "source": "{{template_dir}}/../../../terraform-aws-influx",
    "destination": "/tmp"
  },{
    "type": "shell",
    "inline": [
      "/tmp/terraform-aws-influx/modules/install-kapacitor/install-kapacitor --version {{user `version`}}"
    ],
    "pause_before": "30s"
  }]
}

Your code should look more like this:

{
  "provisioners": [{
    "type": "shell",
    "inline": [
      "git clone --branch <MODULE_VERSION> https://github.com/gruntwork-io/terraform-aws-influx.git /tmp/terraform-aws-influx",
      "/tmp/terraform-aws-influx/modules/install-kapacitor/install-kapacitor --version {{user `version`}}"
    ],
    "pause_before": "30s"
  }]
}

You should replace <MODULE_VERSION> in the code above with the version of this module that you want to use (see the Releases Page for all available versions). That's because for production usage, you should always use a fixed, known version of this Module, downloaded from the official Git repo via git clone. On the other hand, when you're just experimenting with the Module, it's OK to use a local checkout of the Module, uploaded from your own computer via the file provisioner.

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?