InfluxDB stacks

Use InfluxDB stacks to manage InfluxDB templates. When you apply a template, InfluxDB associates resources in the template with a stack. Use the stack to add, update, or remove InfluxDB templates over time.

Save time with stacks

Discover how to use InfluxDB stacks to save time.

Initialize a stack

InfluxDB automatically creates a new stack each time you apply an InfluxDB template without providing a stack ID. To manually create or initialize a new stack, use the influx stacks init command.

  1. influx apply \
  2. -o example-org \
  3. -f path/to/template.yml
  1. influx stacks init \
  2. -o example-org \
  3. -n "Example Stack" \
  4. -d "InfluxDB stack for monitoring some awesome stuff" \
  5. -u https://example.com/template-1.yml \
  6. -u https://example.com/template-2.yml

Read more

Update a stack

Use the influx apply command to update a stack with a modified template. When applying a template to an existing stack, InfluxDB checks to see if the resources in the template match existing resources. InfluxDB updates, adds, and removes resources to resolve differences between the current state of the stack and the newly applied template.

  1. influx apply \
  2. -o example-org \
  3. -u http://example.com/template-1.yml \
  4. -u http://example.com/template-2.yml \
  5. --stack-id=12ab34cd56ef

Read more

View stacks

Use the influx stacks command to view installed InfluxDB stacks and their associated resources.

  1. influx stacks -o example-org

Read more

Remove a stack

Use the influx stacks remove command to remove an InfluxDB stack and all its associated resources.

  1. influx stacks remove \
  2. -o example-org \
  3. --stack-id=12ab34cd56ef

Read more

Key differences between stacks and templates:

  • A template defines a set of resources in a text file outside of InfluxDB. When you apply a template, a stack is automatically created to manage the applied template.
  • Stacks add, modify or delete resources in an instance.
  • Templates do not recognize resources in an instance. All resources in the template are added, creating duplicate resources if a resource already exists.

Related articles